[clug] Apache configuration puzzle

David Tulloh david at tulloh.id.au
Wed Aug 20 08:46:52 GMT 2008

Paul Matthews wrote:
> We have to write a lot of cgi scripts at work, and each one needs it's
> environment set up. Apparently this can be done by placing the
> environment variables into a .htaccess file in the cgi directory. Which
> we have done. The real problem is telling the guy who actually runs the
> server what to place in the httpd.conf file.
> and we have tried the following ...
> <Directory "/data/apache/cgi-bin">
>    AllowOverride *Options=PassEnv,SetEnv,UnsetEnv*
>    Options None
>    Order allow,deny
>    Allow from all
> </Directory>

Your AllowOverride syntax is wrong.  AllowOverride takes a set of
categories, see the apache documentation for details.

Example lines would be:
AllowOverride All
AllowOverride FileInfo

The All is a nice hammer and handy if you don't have bad users you have
to watch out for.  The SetEnv documentation indicates that the FileInfo
override is required so the second line should be sufficient for you.

So I think the following should work, I haven't tested it though.

<Directory "/data/apache/cgi-bin">
   AllowOverride FileInfo
   Options None
   Order allow,deny
   Allow from all


More information about the linux mailing list