Installation guide

194 Chapter 14. Apache HTTP Server
Using Directory tags, the DocumentRoot is defined to have less rigid parameters, so that HTTP
requests can be served from it.
The cgi-bin directory is set up to allow the execution of CGI scripts, with the ExecCGI option. If
you need to execute a CGI script in another directory, you will need to set ExecCGI for that directory.
For example, if your cgi-bin is /var/www/cgi-bin, but you want to execute CGI scripts from
within /home/my_cgi_directory, add an ExecCGI directive to a set of Directory directives like
the following to your httpd.conf file:
Directory /home/my_cgi_directory
Options +ExecCGI
/Directory
To allow CGI script execution in /home/my_cgi_directory, you will need to take a few extra
steps besides setting ExecCGI. You will also need to have the AddHandler directive uncommented
to identify files with the .cgi extension as CGI scripts. See Section 14.5.59 for instructions on setting
AddHandler. Permissions for CGI scripts, and the entire path to the scripts, must be set to 0755.
14.5.24. Options
The Options directive controls which server features are available in a particular directory. For ex-
ample, under the restrictive parameters specified for the root directory, Options is set to only Fol-
lowSymLinks. No features are enabled, except that the server is allowed to follow symbolic links in
the root directory.
By default, in your DocumentRoot directory, Options is set to include Indexes, Includes and
FollowSymLinks. Indexes permits the server to generate a directory listing for a directory if no
DirectoryIndex (for example, index.html) is specified. Includes means that server-side in-
cludes are permitted. FollowSymLinks allows the server to follow symbolic links in that directory.
You will also need to include Options statements for directories within virtual hosts directives, if
you want your virtual hosts to recognize those Options.
For example, server side includes are already enabled inside the /var/www/html directory, because
of the Options Includes line within the
Directory "/var/www/html" directives section.
However, if you want a virtual host to recognize server side includes, you will need to include a section
like the following within your virtual host’s tags:
Directory /var/www/html
Options Includes
/Directory
14.5.25. AllowOverride
The AllowOverride directive sets whether or not any Options can be overridden by the declara-
tions in an .htaccess file. By default, both the root directory and the DocumentRoot are set to
allow no .htaccess overrides.
14.5.26. Order
The Order directive simply controls the order in which allow and deny directives are evaluated.
Your server is configured to evaluate the Allow directives before the Deny directives for your Docu-
mentRoot directory.