Installation guide

Chapter 14. Apache HTTP Server 201
14.5.56. AddLanguage
AddLanguage associates filename extensions with specific content languages. This directive is mostly
useful for content negotiation, when the server returns one of several documents based on the client’s
language preference as set in their browser.
14.5.57. LanguagePriority
LanguagePriority allows you to set precedence for different languages in which to serve files,
which will be in effect if the client expressed no preference for language in their browser.
14.5.58. AddType
Use the AddType directive to define MIME type and file extension pairs. For example, if you are
using PHP4, your Web server is using the AddType directive to make your Web server recognize files
with PHP extensions (.php4, .php3 .phtml .php) as PHP MIME types. The following directive
tells the Apache HTTP Server to recognize the .shtml file extension:
AddType text/html .shtml
AddHandler server-parsed .shtml
You will need to include the above line within the virtual host tags for any virtual hosts which should
allow server side includes.
14.5.59. AddHandler
AddHandler maps file extensions to specific handlers. For example, the cgi-script handler can
be used matched with the extension .cgi to automatically treat a file ending with .cgi as a CGI
script. This will work, even for files outside of the ScriptAlias directory, as long as you follow the
instructions provided here.
You have a CGI AddHandler line in your httpd.conf file:
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 14.5.23 for more information about setting ExecCGI for a directory. Additionally, 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.
14.5.60. 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.