Filesystem Layout


Filesystem Layout

This section tells you where you can find many of the files you may need to work with as you set up and modify an Apache server.

Binaries, scripts, and modules

The Apache server and related binary files are kept in several directories:

/usr/sbin/httpd The Apache server (daemon).

/usr/sbin/apachectl Starts and stops Apache. The httpd init script calls apachectl.

/usr/bin/htpasswd Creates and maintains password files used by the Apache authentication module (page ).

/usr/sbin/rotatelogs Rotates Apache log files so the files do not get too large. See logrotate (page ) for more information about rotating log files.

/etc/httpd/modules Holds module binaries. Two of the most frequently used module binary files are mod_perl.so and mod_python.so. This directory is a symbolic link to /usr/lib/httpd/modules (page ).

Configuration files

Apache configuration files are kept in the /etc/httpd/conf and /etc/httpd/conf.d directories.

/etc/httpd/conf/httpd.conf Holds configuration directives. This file is the main Apache configuration file. The discussion of configuration directives starts on page . Refer to "" on page for a description of the httpd.conf file.

/etc/httpd/conf/magic Provides MIME (page ) file type identification (the MIME hints file). It is not normally changed. See magic number (page ) for more information.

/etc/httpd/conf/ssl.* RHEL Holds files and directories used by mod_ssl (page ).

/etc/pki/tls/certs FEDORA Holds files and directories used by mod_ssl (page ).

/etc/httpd/conf.d Holds configuration files for modules including php and mod_perl.

Logs

Logs are kept in /var/log/httpd (there is a symbolic link at /etc/httpd/logs):

/var/log/httpd/access_log Logs requests made to the server.

/var/log/httpd/error_log Logs request and runtime server errors.

/var/log/httpd/ssl_*_log Holds mod_ssl logs.

Web documents

Web documents (including the Web pages displayed by client browsers), custom error messages, and CGI scripts are kept in /var/www by default:

/var/www/cgi-bin Holds CGI scripts (page ).

/var/www/error Holds default error documents. You can modify these documents to conform to the style of your Web site. See ErrorDocument (page ).

/var/www/icons Holds icons used to display directory entries.

/var/www/manual Holds the Apache Reference Manual and Users' Guide. FEDORA Present only if the httpd-manual package is installed.

Document root

By default, the document root (page ) is /var/www/html. You can change this location with the DocumentRoot directive (page ). In addition to content for the Web pages that Apache serves, this directory can house the usage directory, which holds webalizer (page ) output.

.htaccess files

A .htaccess file contains configuration directives and can appear in any directory in the document root hierarchy. The location of a .htaccess file is critical: The directives in a .htaccess file apply to all files in the hierarchy rooted at the directory that holds the .htaccess file. You must use the AllowOverride directive (page ) to cause Apache to examine .htaccess files. Based on the Red Hat httpd.conf file, Apache does not answer requests for files whose names start with .ht, so clients cannot read .htaccess files.