[lug] Apache CGI's and Redhat
Eric Kilfoil
ekilfoil at viawest.net
Tue Jun 19 14:17:34 MDT 2001
Hrmm... this seems like a very odd config. I would use something like
this:
<Directory "/home/www/">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Virtualhost blah.blah.blah.blah>
ServerAdmin blah at schmack.com
DocumentRoot /home/www/test/html
ServerName blah.blah.blah.blah
ErrorLog blah
ScriptAlias /cgi-bin/ "/home/www/test/html/cgi-bin/"
</VirtualHost>
You don't really need the rest of that stuff. The "ScriptAlias" config
option tells apache that everything in the specified directory should be
executed (not read).
ExecCGI tells apache that scripts ending with the specified extension
should be executed. Also, keep in mind, that you should use something
such as:
Add-handler cgi-script .cgi
instead of
Add-handler cgi-script cgi
With the second example, someone requesting a file named mycgi would be
executed, which may not be desired. With the first example, the file name
would be required to be my.cgi to get executed.
eric
On Tue, 19 Jun 2001, Greg Horne wrote:
> Ok, Here goes. I have been working on a problem on my machine for a few
> days now. I am using Apache 1.3.3 on Redhat 7.0 with kernel 2.4.5. I have
> allowed .cgi access in this way:
> -------------------------------------
> snippet from: httpd.conf
> -------------------------------------
> AddHandler cgi-script cgi pl
>
> Alias /cgi-bin/ "/home/www/*/html/cgi-bin/"
>
> <Directory "/cgi-bin/">
> AllowOverride None
> Options ExecCGI
> Order allow,deny
> Allow from all
> </Directory>
>
> <Virtualhost blah.blah.blah.blah>
> ServerAdmin blah at schmack.com
> DocumentRoot /home/www/test/html
> ServerName blah.blah.blah.blah
> ErrorLog blah
> ScriptAlias /cgi-bin/ "/home/www/test/html/cgi-bin/"
> </VirtualHost>
> -------------------------------------
>
> With this I can execute any *.cgi files. The problem is I can't execute
> anything else that is in the directory like *.pl or I get an "Error 500
> Interal Server Problem, premature end of script headers". At the top of the
> scripts I am pointing the the directory that contains perl, which I verified
> by finding it myself. Eg. #!/usr/bin/perl
>
> If anybody can help me I would be very thankful. Like I said I have been at
> this for a while, and found a lot of message boards to be of no use. Thanks
> in advance.
>
> Greg
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>
More information about the LUG
mailing list