httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Owen Boyle <>
Subject Re: cgi question
Date Tue, 09 Apr 2002 11:41:38 GMT
Jim Hadfield wrote:
> Owen,
> So, I presume the correct structure is like this:
>     ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
>     ScriptAlias /cgi-bin  "/var/www/html/snowbankih/cgi-bin/"

Close - but you can't have "cgi-bin" twice as a ScriptAlias. The way you
have it, how is apache supposed to know which directory to look in for a
CGI program?

A couple of stylistic notes:
- In some contexts, a trailing-slash causes problems. So I don't have to
remember when I can and can't use it, I systematically *never* use a
trailing-slash in the config. It is never *required*. 
- quotes are optional too, I avoid them for readability.

So something like:

>     ScriptAlias /cgi-bin  /var/www/cgi-bin
>     ScriptAlias /cgi-snow /var/www/html/snowbankih/cgi-bin

would be better.

>     #
>     # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
>     # CGI directory exists, if you have that configured.
>     #
>     <Directory "/var/www/html/snowbankih/cgi-bin">
>         AllowOverride None
>         Options None
>         Order allow,deny
>         Allow from all
>     </Directory>

Don't put "Options None". That will defeat "Options ExecCGI" which is on
by default and thus disable CGIs. Do you have a reason for this
directive? If you want to suppress a particular function, it's better to
do so explicitly, e.g. "Options -Indexes" to suppress directory


Owen Boyle.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message