The following table provides the default location of the main Apache configuration file on multiple operating systems. Notice that since versions 1.3 and 2 of the server may need to coexist side by side, the name of the file may be different for each version.
The main Apache configuration file is called httpd.conf. The location of this file varies depending on whether you are using Windows or Linux, and whether you compiled Apache from source code or used the binary provided by your distribution. Check the locations suggested in the previous table. Apache uses plain text files for configuration. The configuration files can contain directives and containers (also known as "sections"). You can place comments inside the file by placing a hash mark (#) at the beginning of a line. Comment lines will be ignored by Apache. A directive can span several lines if you end the previous line with a backslash character (\). Directives control every aspect of the server. You can place directives inside containers, so they only apply to content served from a certain directory or location, requests served by a particular virtual host, and so on. When an argument to a directive is a relative path, it is assumed to be relative to the server installation path (server root). For example, if you installed Apache from source as described earlier in this chapter, the server root is /usr/local/apache or /usr/local/apache2. You can change the default with the ServerRoot directive. |