Pick a Free OS

User login

Navigation

Web server tutorial - Part 2

make certain files to be certain types.

For example, the PHP3 module (not part of the Apache distribution - see http://www.php.net)

will typically use:


AddType application/x-httpd-php3 .php3

AddType application/x-httpd-php3-source .phps

The following is for PHP/FI (PHP2):


AddType application/x-httpd-php .phtml

AddType application/x-tar .tgz

AddHandler: Allows you to map certain file extensions to "handlers",

actions unrelated to filetype. These can be either built into the server or

added with the Action command (see below)

If you want to use server side includes, or CGI outside ScriptAliased directories,

uncomment the following lines.

To use CGI scripts:

AddHandler cgi-script .cgi

To use server-parsed HTML files

AddType text/html .shtml

AddHandler server-parsed .shtml

Uncomment the following line to enable Apache's send-asis HTTP file feature

AddHandler send-as-is asis

If you wish to use server-parsed imagemap files, use

AddHandler imap-file map

To enable type maps, you might want to use

AddHandler type-map var

Action: Lets you define media types that will execute a script whenever a matching

file is called. This eliminates the need for repeated URL pathnames for oft-used

CGI file processors.

Format: Action media/type /cgi-script/location

Format: Action handler-name /cgi-script/location

MetaDir: Specifies the name of the directory in which Apache can find meta

information files. These files contain additional HTTP headers to include when

sending the document

MetaDir .web

MetaSuffix: Specifies the file name suffix for the file containing the meta

information.

MetaSuffix .meta