Home >Backend Development >PHP Tutorial >APACHE(4)_PHP Tutorial
4.5 mod_cgi module
This module is included in the mod_cgi.c file and will be compiled by default. It provides
CGI script execution capabilities. Any file with mime type application/x-httpd-cgi
will be processed by this module.
4.5.1 Summary
Any file with the mime type of application/x-httpd-cgi will be treated as a
CGI script and executed by the server, with the output passed back to the client. Files can be of this type by
using an extension defined by the AddType directive, or by being placed in a directory
set by ScriptAlias.
When the server starts a CGI script, it will add an environment parameter called DOCUMENT_ROOT
. This parameter will contain the contents of the DocumentRoot configuration.
4.5.2 CGI environment parameters
This server will set the CGI environment parameters defined in the CGI specification, with the following
provisos:
REMOTE_HOST
This is only available if the server does not match MINIMAL_DNS It is set when compiling.
REMOTE_IDENT
This is only set if IdentityCheck is set to on.
REMOTE_USER
This is only set if the CGI script requires validation.
4.6 mod_dir module
This module is included in the mod_dir.c file and will be compiled by default. It provides
for directory indexing purposes.
4.6.1 Summary
This module controls directory indexing. Directory indexes can come from two sources:
. A file written by a user, typically a file called index.html
. The DirectoryIndex directive sets the name of this file.
. The other is a list generated by the server. Other directives control the
format of this list. AddIcon, AddIconByEncoding and AddIconByType are all
used to set the list of icons used to display different file types; for each file type listed
, the first matching image listed is displayed. Show.
4.6.2 AddDescription
Syntax: AddDescription string file...
Used for: server config, virtual host, directory, .htaccess
Requirements: Indexes
Status: Basic
Module: mod_dir
This is to set the description to be displayed for a certain file, for use by FancyIndexing.
File refers to the file extension, partial file name, alternative character expression or
full file name of the file to be described.
The string is enclosed in double quotes ("). For example:
AddDescription "The planet Mars" /web/pics/mars.gif
4.6.3 AddIcon
Syntax: AddIcon icon name name ...
Used for: server config, virtual host, directory, .htaccess