You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Richard M. Lemanski" <rl...@ee.siue.edu> on 2000/07/13 08:59:48 UTC

Mod_perl-enabled Apache questions?

Hello all,

If you have a mod_perl-enabled Apache server, how does it determine
whether the script you are sending to it is mod_perl or mod_cgi?  I am
assuming the server scripts directory that you specify when running the
script from your web browser?

http://192.168.0.1/cgi-bin/cgi_test.pl -- example for mod_cgi

On my system, the httpd.conf file has defaulted the ScriptAlias value to
be /home/httpd/cgi-bin for mod_cgi scripts.  I have not yet configured
Apache to handle mod_perl scripts.

I have been reading "Intro to Mod_Perl" by Jamie Scheinblum and he
recommends that if you had Apache installed with the OS you might be
better off removing it and installing a version you built yourself.  I
do not want to screw up my Linux system.

I currently have the following loaded with the exception of mod_perl:

VERSION        EXECUTABLE
perl 5.005_03   /usr/bin/perl
apache 1.3.9     /usr/sbin/apachectl, /home/httpd/cgi-bin (script dir)
mod_perl 1.24  ???

Would it be ok to install the mod_perl module as is?  My Apache server
is just set to the defaults and I know that the settings in the
httpd.conf file should be tweaked, but if I install mod_perl, I am
understand that it will be limited to the configuration that was in
place for Apache at the time of the install.  Is that correct?

Thanks for the help.

Rich


Re: Mod_perl-enabled Apache questions?

Posted by "G.W. Haywood" <ge...@jubileegroup.co.uk>.
Hi there,

On Thu, 13 Jul 2000, Richard M. Lemanski wrote:

> If you have a mod_perl-enabled Apache server, how does it determine
> whether the script you are sending to it is mod_perl or mod_cgi?  I am
> assuming the server scripts directory that you specify when running the
> script from your web browser?

I do not understand what you mean by `sending' scripts to Apache.  The
browser sends to the server a request for a service (that's why the
server is called a server), not a script.  The server looks at the
request and decides what to do with it.  The decision may give rise to
many different kinds of reply: a static document; the output from a
program which does all kinds of wonderful things like communication
with other mnachines, database lookups, whatnot; a flat refusal (or at
least requests for authentication and authorization); and so on.  The
configuration tells Apache (amongst other things) how to make all the
decisions.  Roughly speaking Apache tells mod_perl to handle the
request if, after translating the request URL to a Location (which may
not in fact exist as for example a directory in your filesystem), it
turns out that the resources in that Location are to be handled by
mod_perl.

It's complex.  PLEASE read the Guide (http://perl.apache.org/guide),
and while you're at it get a copy of the Eagle Book and something
about HTTP and read those too.  Without doing this you will not have
the understanding you need to build, install and effectively use a
mod_perl Apache.  It is going to need some dedication on your part.

> On my system, the httpd.conf file has defaulted the ScriptAlias
> value to be /home/httpd/cgi-bin for mod_cgi scripts.  I have not yet
> configured Apache to handle mod_perl scripts.

ScriptAlias is for mod_cgi.  Use Alias for mod_perl.  It's in the Guide.

> I have been reading "Intro to Mod_Perl" by Jamie Scheinblum and he
> recommends that if you had Apache installed with the OS you might be
> better off removing it and installing a version you built yourself.

He's right.  And while you're at it you should have a go at building a
kernel, and anything else you want to use.  In the old days the first
thing they used to make an apprentice do was to make his own tools.

It was a good system.

> I do not want to screw up my Linux system.

Yes, you do.  It's the best way to find out how it works.  Done it
loadsa times myself.  Don't even think about mod_perl until you can
dismantle the OS and put it back together three times in an evening.

> I currently have the following loaded with the exception of mod_perl:
> 
> VERSION        EXECUTABLE
> perl 5.005_03   /usr/bin/perl
> apache 1.3.9     /usr/sbin/apachectl, /home/httpd/cgi-bin (script dir)
> mod_perl 1.24  ???

This doesn't help very much.  Apachectl is not the Apache binary, it
is a control script.   *** Read mod_perl/SUPPORT ***

> Would it be ok to install the mod_perl module as is?

I don't think it's going to fly.

> My Apache server is just set to the defaults and I know that the
> settings in the httpd.conf file should be tweaked, but if I install
> mod_perl, I understand that it will be limited to the configuration
> that was in place for Apache at the time of the install.  Is that
> correct?

This makes no sense.  You need to understand at least the basics of
Apache configuration to be able to configure it to run mod_perl.  The
concept of tweaking is for those who have mastered the art and want to
fine-tune for performance or whatever.  You need to decide what you
want the server to do (done that yet?) and then to decide how to
configure it to do that.  There are loads of books and other documents
to read.  Please read some!  In the long run it's no good for you to
try to short-circuit the process, and you will lose the goodwill of
the people who will later on be such a tremendous help to you if you
do not sit down and study the subjects thoroughly.

Sorry to be such a bore, but it's for your own good.  :)

73,
Ged.