Configuration File Basics


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.

Table 1.1. The Location of httpd.conf on Different Systems

Configuration File Location

Platform

/etc/httpd/httpd.conf
/etc/httpd/httpd2.conf

Suse, Mandrake, older
Red Hat systems

/etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd2.conf

Newer Red systems, Fedora Core

/usr/local/apache2/conf
/usr/local/apache/conf

When compiling from source as explained earlier in this chapter

c:\Program Files\Apache Group\Apache2\conf\httpd.conf

Windows

c:\Program Files\Apache Group\Apache2\conf\httpd.conf

 

/private/etc/httpd/httpd.conf

Mac OS X


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.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net