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 824).

/usr/sbin/rotatelogs Rotates Apache log files so the files do not get too large. See logrotate (page 559) 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 820).

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 794. Refer to "The Red Hat httpd.conf File" on page 814 for a description of the httpd.conf file.

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

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

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

/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 821).

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

/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 788) is /var/www/html. You can change this location with the DocumentRoot directive (page 796). In addition to content for the Web pages that Apache serves, this directory can house the usage directory, which holds webalizer (page 825) 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 813) 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.




A Practical Guide to Red Hat Linux
A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)
ISBN: 0132280272
EAN: 2147483647
Year: 2006
Pages: 383

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