210
Chapter 13:Apache
AddHandler cgi-script .cgi
You will have to uncomment the line. Then Apache will execute CGI scripts for files ending in .cgi,
even if they are outside of the ScriptAlias, which is set by default to locate your /cgi-bin/
directory in /var/www/cgi-bin/.
You will also need to set ExecCGI as an Options for any directory containing a CGI script. See
Section 13.3.29, Directory for more information about setting ExecCGI for a directory. Addition-
ally, you will need to make sure the permissions are set correctly for the CGI scripts and the directories
containing CGI scripts. CGI scripts and the entire directory path to the scripts must be set to 0755.
You will need to add the same AddHandler line to your VirtualHost setup, if you are using
virtual hosts and you want them to also recognize CGI scripts outside the ScriptAlias.
In addition to CGI scripts, your Web server also uses AddHandler to process server-parsed HTML
and imagemap files.
13.3.66 Action
Action allows you to specify a MIME content type and CGI script pair, so that whenever a file of
that media type is requested, a particular CGI script will be executed.
13.3.67 MetaDir
MetaDir specifies the name of a directory where your Web server should look for files containing
meta information (extra HTTP headers) to include when serving documents.
13.3.68 MetaSuffix
MetaSuffix specifies the filename suffix for the file that contains meta information (extra HTTP
headers), which should be located in the MetaDir directory.
13.3.69 ErrorDocument
By default, in the event of a problem or error, your Web server outputs a simple (and usually cryptic)
error message back to the requesting client. Instead of using the default, you can use ErrorDocu-
ment to configure your Web server so that it outputs a customized message or redirects the client to
a local or external URL. The ErrorDocument directive simply associates a HTTP response code
with a message or a URL which will be sent back to the client.
13.3.70 BrowserMatch
The BrowserMatch directive allows your server to define environment variables and/or take appro-
priate actions based on the User-Agent HTTP header field, which identifies the client's browser. By
default, your Web server uses BrowserMatch to deny connections to specific browsers with known
Need help?
Do you have a question about the LINUX 7.2 and is the answer not in the manual?