Monday, June 16, 2008

Apache: httpd.conf Configuration

ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.

ServerType: This directive is determines whether the server is spawned by the inetd process on a per query basis, or runs as a standalone process. For performance reasons, it is preferred to run it as a standalone process. It is only possible to run the server under inetd if it is started by the root account. (default standalone)

ServerAdmin: Your address, where problems with the server should be e-mailed. This address appears on some server-generated pages, such as error documents (default: you@example.com)

ServerName: gives the name and port that the server uses to identify itself. This can often be determined automatically, but we recommend you specify it explicitly to prevent problems during startup. If your host doesn't have a registered DNS name, enter its IP address here.

DocumentRoot: The directory out of which you will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations.

TimeOut: This directive sets the maximum amount of time the server will allow a connection to remain open (default 1200)

Listen: Allows you to bind Apache to specific IP addresses and/or ports(0 - 65536), instead of the default (port 80).

LoadModule: To be able to use the functionality of a module which was built as a Dynamic Shared Object (DSO) you have to place corresponding `LoadModule' lines at this location so the directives contained in it are actually available _before_ they are used. Statically compiled modules (those listed by `httpd -l') do not need to be loaded here.

User/Group: The name (or #number) of the user/group to run httpd as. It is usually good practice to create a dedicated user and group for running httpd, as with most system services (default user/daemon)

: Each directory to which Apache has access can be configured with respect to which services and features are allowed and/or disabled in that directory (and its subdirectories). First, we configure the "default" to be a very restrictive set of features.

ErrorLog: The location of the error log file. If you do not specify an ErrorLog directive within a container, error messages relating to that virtual host will be logged here. If you *do* define an error logfile for a container, that host's errors will be logged there and not here (default: logs/error_log)

TransferLog: This directive sets the location of the access log file (default logs/access_log)

PidFile: This directive sets the location of the process id log file (default logs/httpd.pid)

LogLevel: Control the number of messages logged to the error_log. Possible values include: debug, info, notice, warn, error, crit, alert, emerg (default: warn)

DefaultType: the default MIME type the server will use for a document if it cannot otherwise determine one, such as from filename extensions. If your server contains mostly text or HTML documents, "text/plain" is a good value. If most of your content is binary, such as applications or images, you may want to use "application/octet-stream" instead to keep browsers from trying to display binary files as though they are text(default text/plain)

mod_mime_magic: module allows the server to use various hints from the contents of the file itself to determine its type. The MIMEMagicFile directive tells the module where the hint definitions are located.

Customizable error responses: come in three flavors: 1) plain text 2) local redirects 3) external redirects. (eg. ErrorDocument 404 /missing.html)

EnableMMAP and EnableSendfile: On systems that support it, memory-mapping or the sendfile syscall is used to deliver files. This usually improves server performance, but must be turned off when serving from networked-mounted filesystems or if support for these functions is otherwise broken on your system.

IdentityCheck: With this directive set to on, the server will attempt to record the userid of each query to the server. Keep this directive set to off unless you are willing to devote a significant amount of network bandwidth to this function.

No comments: