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