These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/Apache Configuration

Classnotes | UNIX02 | RecentChanges | Preferences

Showing revision 2
Apache's configuration file format contains markup similar to HTML or XML. This makes this file fairly easy to visualize and understand.

On Red Hat (and many other UNIX systems) Apache's configuration files are installed in /etc/httpd/conf. However, when built from source, Apache's configuration files have traditionally defaulted to /var/apache/conf. The move to /etc/httpd is a logical one, as most system configuration files go there, but you should be aware of the variants.

The basic configuration unit of the Apache config file is known as a Directive. There is allowed one Directive per line. Groups of Directives are broken up into Modules.

Taking a look at an example module from /etc/httpd/conf/httpd.conf:

 <Directory />
    Options FollowSymLinks?
    AllowOverride? None
 </Directory?>

We see that it is quite similar to various markup languages.

Global Environment Settings

Most settings in this section of the configuration file are well documented. However, there are a few which we should examine more carefully.

 #
 # ServerType? is either inetd, or standalone.
 # Inetd mode is only supported on
 # Unix platforms.
 #
 ServerType? standalone

 #
 # ServerRoot?: The top of the directory tree under which the server's
 # configuration, error, and log files are kept.
 # Do NOT add a slash at the end of the directory path.
 #
 ServerRoot? "/etc/httpd"

 #
 # Number of servers to start initially --- should be a reasonable ballpark
 # figure.
 #
 StartServers? 8

 #
 # Limit on total number of servers running, i.e., limit on the number
 # of clients who can simultaneously connect --- if this limit is ever
 # reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
 # It is intended mainly as a brake to keep a runaway server from taking
 # the system with it as it spirals down...
 #
 MaxClients? 150

 #
 # MaxRequestsPerChild?: the number of requests each child process is
 # allowed to process before the child dies.  The child will exit so
 # as to avoid problems after prolonged use when Apache (and maybe the
 # libraries it uses) leak memory or other resources.  On most systems, this
 # isn't really needed, but a few (such as Solaris) do have notable leaks
 # in the libraries. For these platforms, set to something like 10000
 # or so; a setting of 0 means unlimited.
 #
 # NOTE: This value does not include keepalive requests after the initial
 #       request per connection. For example, if a child process handles
 #       an initial request and 10 subsequent "keptalive" requests, it
 #       would only count as 1 request towards this limit.
 #
 MaxRequestsPerChild? 1000

Main Server Configuration

This next section is the one which you will spend most of your time on.

Ere I am JH

Adding New Directories

For many reasons (including security)

See also http://httpd.apache.org/docs/configuring.html


Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions | View current revision
Edited April 26, 2003 3:28 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.