Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

While examples in the main Apache HTTP Server documentation assume that you are using the standard file layout distributed from apache.org, many third-party distributors change the layout to conform to local policies. This can make it difficult to follow the examples and to find various important files. Using the information below, you can find where things live on your local install, and compare it to the standard Apache httpd paths.

Table of Contents

Apache httpd 2.4 default layout (apache.org source package):

No Format

ServerRoot              ::      /usr/local/apache2
DocumentRoot            ::      /usr/local/apache2/htdocs
Apache Config File      ::      /usr/local/apache2/conf/httpd.conf
Other Config Files      ::      /usr/local/apache2/conf/extra/
SSL Config File         ::      /usr/local/apache2/conf/extra/httpd-ssl.conf
ErrorLog                ::      /usr/local/apache2/logs/error_log
AccessLog               ::      /usr/local/apache2/logs/access_log
cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but some of the bundled scripts are 644)
binaries (apachectl)    ::      /usr/local/apache2/bin
start/stop              ::      /usr/local/apache2/bin/apachectl (start|restart|graceful|graceful-stop|stop|configtest)

Debian, Ubuntu (Apache httpd 2.

...

x):

No Format

ServerRoot              ::      /usretc/local/apache2
DocumentRoot            ::      /usr/local/apache2/htdocsvar/www
Apache Config File Files     ::      /usretc/localapache2/apache2/conf/httpd.conf
Other Config Files      ::      /usr/local/apache2/conf/extra/
SSL Config File         ::      /usr/localetc/apache2/conf/extra/httpd-ssl.conf
ErrorLogports.conf
Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations        ::      /usr/local/etc/apache2/mods-available, /etc/apache2/logs/error_log
AccessLogmods-enabled
ErrorLog                ::      /usrvar/locallog/apache2/logs/access_error.log
cgi-bin  AccessLog               ::      /usrvar/locallog/apache2/access.log
cgi-bin (enabled by default, but the bundled scripts are 644)                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/local/apache2/binsbin
start/stop              ::      /usretc/localinit.d/apache2/bin/apachectl (start|stop|restart|reload|gracefulforce-reload|gracefulstart-stophtcacheclean|stop|configtest-htcacheclean)

Apache httpd 2.0 default layout (apache.org source package):

No Format

ServerRoot              ::      /usr/local/apache2
DocumentRoot            ::      /usr/local/apache2/htdocs
Apache Config File      ::      /usr/local/apache2/conf/httpd.conf
SSL Config              ::      /usr/local/apache2/conf/ssl.conf
ErrorLog                ::      /usr/local/apache2/logs/error_log
AccessLog               ::      /usr/local/apache2/logs/access_log
cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644)
binaries (apachectl)    ::      /usr/local/apache2/bin
start/stop              ::      /usr/local/apache2/bin/apachectl (start|stop|graceful|configtest)

Debian, Ubuntu (Apache httpd 2.x):

No Format

ServerRoot              ::      /etc/apache2
DocumentRoot            ::      /var/www
Apache Config Files     ::      /etc/apache2/apache2.conf
                        ::      /etc/apache2/ports.conf
Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations        ::      /etc/apache2/mods-available, /etc/apache2/mods-enabled
ErrorLog                ::      /var/log/apache2/error.log
AccessLog               ::      /var/log/apache2/access.log
cgi-bin                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean)

Notes:

  1. The Debian/Ubuntu layout is fully documented in /usr/share/doc/apache2/README.Debian
  2. Debian/Ubuntu use symlinks to configure vhosts and load modules. Configuration files are created in their respective sites-available and mods-available directories. To activate vhosts and modules, symlinks are created in the respective sites-enabled and mods-enabled directories to the config files in either sites-available and mods-available. Debian provides scripts to handle this process called 'a2ensite' and 'a2enmod' which activates vhosts and modules.
  3. The default vhost is defined in /etc/apache2/sites-available/default, and overrides the DocumentRoot set in the server context.

Fedora Core, CentOS, RHEL:

No Format

ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
Other Config Files      ::      /etc/httpd/conf.d
Module Locations        ::      /usr/lib/httpd/modules
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)
binary                  ::      /usr/sbin/httpd
runtime directory       ::      /etc/httpd/run
start/stop              ::      /sbin/service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}

Notes:

  1. There is an extra config file in /etc/sysconfig/httpd which can be used to change to the worker mpm /usr/sbin/httpd.worker.
  2. Extra config files named *.conf are loaded from /etc/httpd/conf.d. This directory is used by packages like mod_python for drop-in configs
  3. If you're having issues with authorization and your permissions are correct, you might have problems with SELinux permissions. Take a look at httpd_selinux(8) and related documentation. Particularly sealert(8) can be used for analysis and suggested solutions.

RedHat 9.0 and older:

No Format

ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      /sbin/service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}

Mandriva (Apache httpd 2.2):

No Format

ServerRoot              ::      /etc/httpd
Primary Config Fle      ::      /etc/httpd/conf/httpd.conf
DocumentRoot            ::      /var/www/html
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /var/www/cgi-bin
binary                  ::      /usr/sbin/httpd
start/stop              ::      /sbin/service httpd
{start|stop|restart|reload|graceful|condreload|closelogs|update|condrestart|status|extendedstatus|configtest|configtest_vhosts|semcleanrestart|debug|show_defines}

Mac OS X (Leopard, Apache httpd 2.2):

No Format

ServerRoot              ::      /usr
Primary Config Fle      ::      /etc/apache2/httpd.conf
DocumentRoot            ::      /Library/WebServer/Documents
ErrorLog                ::      /var/log/apache2/error_log
AccessLog               ::      /var/log/apache2/access_log
cgi-bin                 ::      /Library/WebServer/CGI-Executables (empty by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      /usr/sbin/apachectl (start|stop|restart|fullstatus|status|graceful|graceful-stop|configtest|help)

Notes:

  1. apachectl graceful is equivalent to apachectl restart and doesn't keep running connections alive. Similarly, graceful-stop is not graceful.
  2. The /usr/sbin/envvars script is ineffective for setting environment variables. See http://lists.apple.com/archives/web-dev/2008/Apr/msg00059.html

NetBSD Apache httpd 2.0 and 1.3 from pkgsrc (layout is identical):

No Format

ServerRoot              ::      /usr/pkg
Config File             ::      /usr/pkg/etc/httpd/httpd.conf
DocumentRoot            ::      /usr/pkg/share/httpd/htdocs
ErrorLog                ::      /var/log/httpd/error_log
AccessLog               ::      /var/log/httpd/access_log
cgi-bin                 ::      /usr/pkg/libexec/cgi-bin
binaries (apachectl)    ::      /usr/pkg/sbin
start/stop              ::      /etc/rc.d/apache [fast|force|one](start stop restart rcvar reload status poll)
/etc/rc.conf variables  ::      apache=YES, apache_start="start" (or "startssl")

Notes:

  1. The "apache" script must be copied from the installation default /usr/pkg/share/examples/rc.d to /etc/rc.d (for automatic rc.conf usage) or /usr/pkg/etc/rc.d (for advanced usage).

FreeBSD 6.1 (Apache httpd 2.2):

No Format

ServerRoot              ::      /usr/local
Config File             ::      /usr/local/etc/apache22/httpd.conf
DocumentRoot            ::      /usr/local/www/apache22/data
ErrorLog                ::      /var/log/httpd-error.log
AccessLog               ::      /var/log/httpd-access.log
cgi-bin                 ::      /usr/local/www/apache22/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin
start/stop              ::      /usr/local/etc/rc.d/apache22.sh (start|restart|stop|reload|graceful|gracefulstop|configtest)
/etc/rc.conf variables  ::      apache22_enable="YES"

Notes:

  1. Other variables to insert in rc.conf are listed in the comments at the top of the start/stop script
  2. To start 2.2 on freebsd 6.1 the accf_http kernel module must be loaded. To do this once, run {{kldload accf_http }}. To do so at boot time, add accf_http_load=”YES” to /boot/loader.conf
  3. Apache 2.2.6 in the FreeBSD 6.2 release will start regardless of the accf_http kernel module being loaded, and by default doesn't use it. To reverse this, add apache22_http_accept_enable="YES" to /etc/rc.conf (which will cause the kernel module to be loaded and Apache to use it).

FreeBSD 6.1 (Apache httpd 2.0):

No Format

ServerRoot              ::      /usr/local
Config File             ::      /usr/local/etc/apache2/httpd.conf
DocumentRoot            ::      /usr/local/www/data
ErrorLog                ::      /var/log/httpd-error.log
AccessLog               ::      /var/log/httpd-access.log
cgi-bin                 ::      /usr/local/www/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin
start/stop              ::      /usr/local/etc/rc.d/apache2.sh [fast|force|one](start|restart|stop|reload|configtest|rcvar)
/etc/rc.conf variables  ::      apache2_enable="YES"

Notes:

  1. Other variables to insert in rc.conf are listed in the comments at the top of the start/stop script

OpenBSD 5.0 (Apache httpd 1.3 (Hardened version for OpenBSD)):

No Format

ServerRoot              ::      /var/www
Config File             ::      /var/www/conf/httpd.conf
DocumentRoot            ::      /var/www/htdocs
ErrorLog                ::      /var/www/logs/error_log
AccessLog               ::      /var/www/logs/access_log
cgi-bin                 ::      /var/www/cgi-bin
binaries (apachectl)    ::      /usr/sbin/apachectl
start/stop              ::      /usr/sbin/apachectl (start|startssl|stop|restart|graceful|status|fullstatus|configtest|help)
user:group              ::      www:www

Notes:

  1. The OpenBSD team has added default chrooting, privilege revocation, and other security-related improvements to their Apache httpd 1.3 package.

OpenBSD 5.0 (Apache httpd 2.2 (Unedited, non-hardened version)):

No Format

ServerRoot              ::      /var/apache2
Config File             ::      /etc/apache2/httpd2.conf
DocumentRoot            ::      /var/apache2/htdocs/
ErrorLog                ::      /var/apache2/logs/error_log
AccessLog               ::      /var/apache2/logs/access_log
cgi-bin                 ::      /var/apache2/cgi-bin
binaries (apachectl)    ::      /usr/local/sbin/apachectl2
start/stop              ::      /usr/local/sbin/apachectl2 (start|stop|restart|graceful|graceful-stop|status|fullstatus|configtest)
user:group              ::      _apache2:_apache2

Win32 (Apache httpd 2.2):

No Format

ServerRoot              ::      "C:/Program Files/Apache Software Foundation/Apache2.2"
Config File             ::      "C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf"
DocumentRoot            ::      "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ErrorLog                ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/error.log"
AccessLog               ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/access.log"
cgi-bin                 ::      "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
binaries (apachectl)    ::      "C:/Program Files/Apache Software Foundation/Apache2.2/bin"

Notes;

  1. There are extra config files in "C:/Program Files/Apache Software Foundation/Apache2.2/conf/extra" that can be included for options such as vhosts

Solaris 10 (Apache httpd 2.0):

Notes:

  1. The Debian/Ubuntu layout is fully documented in /usr/share/doc/apache2/README.Debian
  2. Debian/Ubuntu use symlinks to configure vhosts and load modules. Configuration files are created in their respective sites-available and mods-available directories. To activate vhosts and modules, symlinks are created in the respective sites-enabled and mods-enabled directories to the config files in either sites-available and mods-available. Debian provides scripts to handle this process called 'a2ensite' and 'a2enmod' which activates vhosts and modules.
  3. The default vhost is defined in /etc/apache2/sites-available/default, and overrides the DocumentRoot set in the server context.

Fedora Core, CentOS, RHEL:

No Format
ServerRoot
No Format

ServerRoot              ::      /usr/apache2
Config File             ::      /etc/apache2/httpd.conf
DocumentRoot            ::      /var/apache2/htdocs
ErrorLog                ::      /var/apache2/logs/error_log
AccessLog               ::      /var/apache2/logs/access_log
cgi-bin                 ::      /var/apache2/cgi-bin
binaries        etc/httpd
Primary Config Fle        ::      /etc/usrhttpd/apache2/bin

Notes:

  1. Config needs to be copied from example file to httpd.conf. Apache-1.3 is the default installation in /etc/init.d and /etc/rc3.d files.

Slackware 14.0+ (Apache httpd 2.4):

No Format

ServerRootconf/httpd.conf
Other Config Files      ::      /etc/httpd/conf.d
Module Locations        ::      /usr/lib/httpd/modules
DocumentRoot            ::      /svrvar/httpdwww/htdocshtml
AccessLogErrorLog                ::      /var/log/httpd/accesserror_log
ErrorLog AccessLog               ::      /var/log/httpd/error_log
binaries (apachectl)access_log
cgi-bin                 ::      /var/usr/sbin
modules         www/cgi-bin (empty and disabled by default)
binary        ::     /usr/lib(64)/httpd
system startup script   ::      /etc/rc.d/rc.httpd (start|restart|graceful|graceful-stop|stop)
Apache config fileusr/sbin/httpd
runtime directory       ::      /etc/httpd/httpd.conf
mod_ssl config filerun
start/stop              ::      /etcsbin/httpd/extra/httpd-ssl.conf
mod_php config file     ::     /etc/httpd/mod_php.conf
vhosts config file      ::     /etc/httpd/extra/httpd-vhosts.conf
cgi-bin                 ::     /srv/httpd/cgi-bin
on-line docs ("manual") ::     /srv/httpd/htdocs/manual

openSUSE and SLES (Apache httpd 2.2):

service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}

Notes:

  1. There is an extra config file in /etc/sysconfig/httpd which can be used to change to the worker mpm /usr/sbin/httpd.worker.
  2. Extra config files named *.conf are loaded from /etc/httpd/conf.d. This directory is used by packages like mod_python for drop-in configs
  3. If you're having issues with authorization and your permissions are correct, you might have problems with SELinux permissions. Take a look at httpd_selinux(8) and related documentation. Particularly sealert(8) can be used for analysis and suggested solutions.

RedHat 9.0 and older:

No Format
ServerRoot        
No Format

ServerRoot              ::      /srv/www
DocumentRoot            ::      /srv/www/htdocs
Apache Config File      ::      /etc/apache2/httpd.conf
OtherPrimary Config FilesFle      ::      /etc/httpd/sysconfigconf/apache2
SSL Config Filehttpd.conf
DocumentRoot            ::      /etcvar/apache2/ssl-global.confwww/html
ErrorLog                ::      /var/log/apache2httpd/error_log
AccessLog               ::      /var/log/apache2httpd/access_log
cgi-bin                 ::      /srvvar/www/cgi-bin
binaries (apachectl)bin (empty and disabled by default)
binary                  ::      /usr/sbin/httpd
start/stop              ::      /etc/init.d/apache2 (start|restart|restart-graceful|reload|graceful|graceful-stop|stop|configtest)

Notes:

  1. Modules are enabled in /etc/sysconfig/apache2 which is read by the startup script. The a2enmod/a2dismod tool can be used to activate/deactivate modules.
  2. See /usr/share/doc/packages/apache2/README.SUSE for more information.

...

sbin/service httpd {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}

Slackware 14.0+ (Apache httpd 2.

...

4):

No Format

ServerRoot              ::      /usr/lib/apache2
DocumentRoot            ::      /varsvr/wwwhttpd/localhost/htdocs
Apache Config File      ::AccessLog       /etc/apache2/httpd.conf
Other Config Files      ::      /var/etclog/conf.d/apache2
Default VHost Confighttpd/access_log
ErrorLog     ::      /etc/apache2/vhosts.d/00_default_vhost.conf
Module Configuration    ::      /var/etclog/apache2/modules.d
Module Locations httpd/error_log
binaries (apachectl)       ::      /usr/lib/apache2/modules
ErrorLogsbin
modules                 ::      /var/log/apache2/error_log
AccessLog usr/lib(64)/httpd
system startup script   ::     /etc/rc.d/rc.httpd (start|restart|graceful|graceful-stop|stop)
Apache config file      ::      /varetc/log/apache2/access_log
cgi-binhttpd/httpd.conf
mod_ssl config file     ::     /etc/httpd/extra/httpd-ssl.conf
mod_php config file     ::      /varetc/www/localhost/cgi-bin
binaries (apache2ctl)httpd/mod_php.conf
vhosts config file      ::      /usr/sbin
start/stop/etc/httpd/extra/httpd-vhosts.conf
cgi-bin                 ::      /etc/init.d/apache2 (start|restart|graceful|stop|configtest)

Notes:

  1. To enable a module, "-D MODULENAME" must be added to APACHE_OPTS in /etc/conf.d/apache2

TODO:

Add:

  • Netware. eek!

...

/srv/httpd/cgi-bin
on-line docs ("manual") ::     /srv/httpd/htdocs/manual