Re: httpd.conf - caching

2001-08-27 Thread Ken Williams

[EMAIL PROTECTED] (allan) wrote:
>im experiencing some heavy modoule-caching annoyance i guess. if i run the
>simple hello.pm (see below) and make a very small change - the change
>might take effect immidiately in the browser but more frequently it will
>show a cached version of the page. 

The guide is your friend:

 http://perl.apache.org/guide/porting.html#Reloading_Modules_and_Required_F

Looks like most of the stuff on that page might make good reading for
you, based on your background.

For overview purposes, the primary resources for help are the docs, the
guide, and this list.  Then there's the Eagle book, and a couple books
still in the pipeline...


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: httpd.conf - caching

2001-08-27 Thread Nick Tonkin

On Mon, 27 Aug 2001 [EMAIL PROTECTED] wrote:

> > Do you know why you are running mod_perl with your apache? 
> 
> to be honest, not entirely :-)

Aha.

> 
> > The "modoule-caching annoyance" you speak of is the basic reason for the
> > existence of mod_perl ... the idea is that the perl code in your module
> > only gets compiled once rather than every time a user requests the URI.
> 
> true, but if it *never* gets recompiled there are reasons to worry.

Well, when I say "only gets compiled once" I mean once per child
process. You can control how many requests each child handles before it
biffs (thus forcing the parent to spawn a new child who will recompile the
code) in the httpd.conf file.

- nick




Re: httpd.conf - caching

2001-08-27 Thread i49242

nick
thanks for the reply, and pointers - i guess i have completely lost overview 
thru the installation mist om mac osX. most of my questions were indeed more 
apache than mod_perl.

> Do you know why you are running mod_perl with your apache? 

to be honest, not entirely :-)

> The "modoule-caching annoyance" you speak of is the basic reason for the
> existence of mod_perl ... the idea is that the perl code in your module
> only gets compiled once rather than every time a user requests the URI.

true, but if it *never* gets recompiled there are reasons to worry.

> There are quite a lot of talk about global variables, actually. It's a
> pretty big deal with this stuff. You need to go to the mod_perl guide,
> and
> spend _SEVERAL HOURS_ reading it and playing with your installation. If
> you devote the necessary time to educating yourself, you'll figure most
> of it out, and you can bring your tough questions to this list.

well to me this is a tough situation and i have spend _SEVERAL HOURS_ reading 
it. anyway thanks again - i figure my real problem is, as you mention yourself, 
in understanding apache before mod_perl.

allan



Re: httpd.conf - caching

2001-08-26 Thread Nick Tonkin


On Sun, 26 Aug 2001, allan wrote:

> im a bit confused – or perhaps bewildered about finally having installed
> mod_perl on mac osX.

Well, that's to be expected. It's a bit confusing first time through.

> these questions should apply cross platform 
> 
> 1) 
> yesterday im quite sure my httpd.conf file was /usr/local/apache/conf/httpd.conf.
> today (after having played around) it suddenly appears to be /etc/httpd/httpd.conf
> 

You don't say how you "played around" ... sounds like you installed apache
in two different locations. In any case, this isn't a mod_perl issue at
all ...


> can this be?
> can i actually tell the sever somehow to use the one in
> /usr/local/apache/conf where the other conf files are.
> 

httpd -f /path/to/your/httpd.conf

(Again, a very basic apache question. You really need to read the docs for
apache. If you keep asking questions like this folks are going to quickly
tire of helping you!)

> 
> the only reason i discovered this was because i wanted to change the
> number of child processes to only one. which brings me to:
> 
> 2)
> im experiencing some heavy modoule-caching annoyance i guess. if i run the
> simple hello.pm (see below) and make a very small change - the change
> might take effect immidiately in the browser but more frequently it will
> show a cached version of the page. 
> (i noticed a pattern in my access_log that the last number-field on the
> lines would be the same if the page didnt change)
> 

Do you know why you are running mod_perl with your apache? The
"modoule-caching annoyance" you speak of is the basic reason for the
existence of mod_perl ... the idea is that the perl code in your module
only gets compiled once rather than every time a user requests the URI.

If you change the code in the module you won't see the changes until a new
child process is spawned and compiles the new code (depending on your
config maybe not even then ...) 

Most static sites don't need mod_perl ... if you are just installing
apache for the first time maybe you should become familiar with running a
webserver before you move on to mod_perlifying it ... ?



> i have read a little about this problem but dont understand the soloution(s).

you can run httpd in single-process mode as you say, or you can look at
Apache::Reload ... this forces your code to be recompiled every time it
has changed (at the cost of checking out whether it has in fact changed,
every request). Try perldoc Apache::Reload ...

> for instance what is the exact procedure for httpd -x?
> is it like this command:
> 
> [localhost:/usr/local/apache/sbin] aju% httpd -x

Well, actually it's httpd -X ...

> 
> this command will do nothing on my system, not even complain.

You should not see anything at the command line. The daemon is running, in
single-process mode, still attached to the terminal in which you started
it, waiting for a request. This again is very basic apache operation. Have
you read the docs that come with your apache?


> if i manually configure my httpd.conf file to only one server-child i
> sometimes get two children?
> 

One parent, one child, probably.

> also there are some talk about global variables, but looking at the code
> i dont see any?
> 

There are quite a lot of talk about global variables, actually. It's a
pretty big deal with this stuff. You need to go to the mod_perl guide, and
spend _SEVERAL HOURS_ reading it and playing with your installation. If
you devote the necessary time to educating yourself, you'll figure most
of it out, and you can bring your tough questions to this list.

> allan

Good luck,

Nick