Apache was designed to be modular, so you can run as lean, or as bloated, a webserver as you like. We discuss the basic configuration and some minor tweaks; all the directives are described at httpd.apache.org/docs/mod/directives.html, but during your Linux installation, the documents were placed in /var/www/html/manual/mod/directives.html . You can reach them via the link on the default web page (for the time being, anyway, because we will be moving these documents later): http://localhost/manual/mod/directives.html . 3.3.1 Modifying the Default ConfigurationApache's configuration file is /etc/httpd/conf/httpd.conf . We'll start with the default configuration file from Apache version 1.3.24. [6] There are many comments in httpd.conf ; read them! This is a great way to get a feel for how the Apache configuration file works. Most of it you'll leave unchanged, but the comments will familiarize you with the available capabilities.
First, change the following: ServerAdmin root@webserver.example.com to: ServerAdmin webmaster@example.com or whoever you want to get all the comments (and complaints) about your web site. You may want joe_user@example.com to be your e-mail address or, more preferably, a webmaster e-mail alias. It should be someone who checks e-mail frequently, for some value of frequent proportional to how often people look at your web site. Apache logs every hit to the webserver (see the section on log files later in this chapter). Some of the information that can be written to the log includes the following:
There are various predefined CustomLog options, logging more or less information. The default logged in /var/log/httpd/ includes some of this information (the client IP address, the date, and a few others). Until your site is running smoothly (and maybe even after), you'll want more information, so use the format that includes the most information. Change the following: CustomLog /var/log/httpd/logs/access_log common to: CustomLog /var/log/httpd/logs/access_log combined Other options include CustomLog /var/log/httpd/logs/access_log agent CustomLog /var/log/httpd/logs/access_log referer But the combined format includes this information, as you might expect from the name . Using combinations of these options, you can customize your logging experience. |