7.2. Apache Configuration

Apache should be correctly configured if Linux was installed as suggested in Chapter 2. Nonetheless, two directives in /etc/httpd/conf/httpd.conf should be checked before you start using CGI. The ScriptAlias directive should be set to the proper directory:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 

The cgi-bin directory should have the proper options:

<Directory "/var/www/cgi-bin"> 
  AllowOverride None 
  Options None 
  Order allow,deny 
  Allow from all 
</Directory> 

The AllowOverride directive tells the server how to handle HTTP authentication with .htaccess files. When the directive is set to None, .htaccess files are ignored.

If you changed anything in httpd.conf, restart the server:

# /etc/init.d/httpd graceful
					

Get Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.