You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2002/04/08 17:27:10 UTC
Re: Configuration of mod-perl and cgi-bin in appach conf file
"Wong, Connie" wrote:
>
> Hello Geoffrey,
hi...
these types of questions are probably more suited to the general mod_perl list, so I've
cc'd them.
>
> My host is running an Apache server with mod-perl, and I have all the html
> files resided in the "/usr/local/apache/htdocs" directory and all my perl
> script is resided in the directory that I created for perl
> "/usr/local/apache/Scripts".
>
> This works fine with the following config in the apache httpsd.conf file.
>
> PerlRequire conf/startup.pl
> PerlFreshRestart On
>
> Alias /Scripts/ /usr/local/apache/Scripts/
>
> <Location /Scripts>
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options +ExecCGI
> PerlSendHeader On
> PerlSetupEnv On
> </Location>
>
> I have 2 questions:
>
> Question #1: running mod-perl
> If I want to create a home for my application, say
> "/home/server_name/proj_A/www", under the www directory,
> I have docs and Scripts subdirectories. The docs subdirectory contains all
> html files and the Scripts directory contains all the perl (mod-perl) files.
> How do I configure this in the apache configuration file in order to make it
> run correctly?
it really depends on what you want to do. the easiest way would be to set the
DocumentRoot to /home/server_name/proj_A/www for the partucular vhost, assuming that your
entire application is the only thing on the vhost.
another option is the <Location> directive, couple with an Alias directive. for help with
generic apache directives, see the documentation at http://httpd.apache.org/docs
>
> Question #2: running cgi - how to configure this in apache conf file?
> Someone else running a CGI program on the same apache server, his
> application is resided in "home/server_name/porj_B/www".
>
> I configured the following directives in the apache configuration file, it
> launches the html page is ok, but it try to invoke the perl (cgi-bin) then I
> got the "Internal Server Error" message. It does not know where to find the
> perl script.
>
> Alias /docs/ "/home/server_name/proj_B/docs/"
> <Directory "/home/server_name/proj_B/docs">
> Options Indexes FollowSymlinks MultiViews
> AllowOverride None
> Order allow,deny
> Allow from all
> </Directory>
>
> ScriptAlias /cgi-bin/ "/home/server_name/proj_B/cgi-bin/"
> <Directory "/home/server_name/proj_B/cgi-bin">
> AllowOverride None
> Options None
> Order allow,deny
> Allow from all
> </Directory>
ScriptAlias is generally used with the <Location> directive. I'm not sure if it will work
with <Directory> at all, but it may - I've never tried. a better approach for <Directory>
containers is probably want to use just the Alias directive and place a SetHandler
cgi-script directive within the <Directory>. that's about the only thing I can see that
may be wrong off the top of my head.
again, since this is just regular mod_cgi stuff, the Apache documentation site would be a
good place to start for general apache setup tips.
HTH
--Geoff