Configuring Apache

Configuration Files

The configuration files determine the web site policies and behaviors.
  1. httpd.conf

  2. srm.conf

  3. access.conf

  4. mime.types

On Unix, the config files can be combined

On Win32, they are combined by default into httpd.conf.

Each line in these files specifies a configuration parameter, called a directive.

Example -- the ServerAdmin directive:
# Your address, where problems with the server
# should be e-mailed.
# This address appears on some server-generated pages,
# such as error documents.
#
ServerAdmin webmaster@keller.com

Example Policies and Behaviors

Lab
  • Go to the C:\Program Files\Apache Group\Apache\conf directory.
  • Peruse each of the four configuration files in a text editor.
  • Select one of the parameters defined in httpd.conf and look up its meaning in the on-line Apache manual.
  • Set the ServerName to your server's name.
  • Set the ServerAdmin to your e-mail address.
  • Turn HostnameLookups On (to make your logs more legible).
  • Modify the Port so that your server listens to port 8111.
    • Stop and restart your server.
    • Does your server respond to requests at port 80 anymore?
    • Does it respond to requests at the new port number?
    • Change your port number back to 80, and stop and restart your server.
  • Change your document root to C:\web
    • Create this directory.
    • Create your own server home page (index.html) in it.
    • Modify the DocumentRoot directive.
    • Stop and restart your server.
    • See that the new home page is shown in your browser.

Configuration File Validation

Lab
  • Check the syntax of your config files.
  • Mangle one and check again.
  • Then fix it.