来源:http://wiki.apache.org/httpd/DistrosDefaultLayout
最常用的Apache路径有:
  1. /etc/httpd/conf/httpd.conf

  2. /usr/local/apache/conf/httpd.conf

  3. /usr/local/apache2/conf/httpd.conf

复制代码
Apache 2.2 default layout (apache.org source package):
  1. ServerRoot              ::      /usr/local/apache2

  2. DocumentRoot            ::      /usr/local/apache2/htdocs

  3. Apache Config File      ::      /usr/local/apache2/conf/httpd.conf

  4. Other Config Files      ::      /usr/local/apache2/conf/extra/

  5. SSL Config File         ::      /usr/local/apache2/conf/extra/httpd-ssl.conf

  6. ErrorLog                ::      /usr/local/apache2/logs/error_log

  7. AccessLog               ::      /usr/local/apache2/logs/access_log

  8. cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644)

  9. binaries (apachectl)    ::      /usr/local/apache2/bin

  10. start/stop              ::      /usr/local/apache2/bin/apachectl (start|restart|graceful|graceful-stop|stop|configtest)

复制代码
Apache 2.0 default layout (apache.org source package):
  1. ServerRoot              ::      /usr/local/apache2

  2. DocumentRoot            ::      /usr/local/apache2/htdocs

  3. Apache Config File      ::      /usr/local/apache2/conf/httpd.conf

  4. SSL Config              ::      /usr/local/apache2/conf/ssl.conf

  5. ErrorLog                ::      /usr/local/apache2/logs/error_log

  6. AccessLog               ::      /usr/local/apache2/logs/access_log

  7. cgi-bin                 ::      /usr/local/apache2/cgi-bin (enabled by default, but the bundled scripts are 644)

  8. binaries (apachectl)    ::      /usr/local/apache2/bin

  9. start/stop              ::      /usr/local/apache2/bin/apachectl (start|stop|graceful|configtest)

复制代码
Apache 1.3 default layout (apache.org source package):
  1. ServerRoot              ::      /usr/local/apache

  2. DocumentRoot            ::      /usr/local/apache/htdocs

  3. Apache Config File      ::      /usr/local/apache/conf/httpd.conf

  4. ErrorLog                ::      /usr/local/apache/logs/error_log

  5. AccessLog               ::      /usr/local/apache/logs/access_log

  6. cgi-bin                 ::      /usr/local/apache/cgi-bin (enabled by default, but the bundled scripts are 644)

  7. binaries (apachectl)    ::      /usr/local/apache/bin

  8. start/stop              ::      /usr/local/apache/bin/apachectl (start|stop|graceful|configtest)

复制代码
Debian, Ubuntu (Apache 2):
  1. ServerRoot              ::      /etc/apache2

  2. DocumentRoot            ::      /var/www

  3. Apache Config Files     ::      /etc/apache2/apache2.conf

  4.                        ::      /etc/apache2/ports.conf

  5. Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default

  6. Module Locations        ::      /etc/apache2/mods-available, /etc/apache2/mods-enabled

  7. ErrorLog                ::      /var/log/apache2/error.log

  8. AccessLog               ::      /var/log/apache2/access.log

  9. cgi-bin                 ::      /usr/lib/cgi-bin

  10. binaries (apachectl)    ::      /usr/sbin

  11. 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 enable vhosts and 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 enables vhosts and modules.
3.The default DocumentRoot is specified in the default vhost config file, /etc/apache2/sites-available/default

Debian, Ubuntu (Apache 1.3):
  1. ServerRoot              ::      /etc/apache

  2. DocumentRoot            ::      /var/www

  3. ErrorLog                ::      /var/log/apache/error.log

  4. AccessLog               ::      /var/log/apache/access.log

  5. cgi-bin                 ::      /usr/lib/cgi-bin

  6. binaries (apachectl)    ::      /usr/sbin

  7. start/stop              ::      /etc/init.d/apache (start|stop|graceful|configtest)

复制代码
Fedora Core, CentOS, RHEL:
  1. ServerRoot              ::      /etc/httpd

  2. Primary Config Fle      ::      /etc/httpd/conf/httpd.conf

  3. Other Config Files      ::      /etc/httpd/conf.d

  4. Module Locations        ::      /usr/lib/httpd/modules

  5. DocumentRoot            ::      /var/www/html

  6. ErrorLog                ::      /var/log/httpd/error_log

  7. AccessLog               ::      /var/log/httpd/access_log

  8. cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)

  9. binary                  ::      /usr/sbin/httpd

  10. runtime directory       ::      /etc/httpd/run

  11. 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 make sure that you try testing with SELinux turned off. Run ‘setenforce 0′ and use ‘chcon’ to fix permissions. Run ‘ls -alZ’ to view the current permissions.’ SELinux first appeared in Fedora Core 3, RHEL 4, and CentOS 4.

RedHat 9.0 and older:
  1. ServerRoot              ::      /etc/httpd

  2. Primary Config Fle      ::      /etc/httpd/conf/httpd.conf

  3. DocumentRoot            ::      /var/www/html

  4. ErrorLog                ::      /var/log/httpd/error_log

  5. AccessLog               ::      /var/log/httpd/access_log

  6. cgi-bin                 ::      /var/www/cgi-bin (empty and disabled by default)

  7. binary                  ::      /usr/sbin/httpd

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

复制代码
Mandriva (Apache 2.2):
  1. ServerRoot              ::      /etc/httpd

  2. Primary Config Fle      ::      /etc/httpd/conf/httpd.conf

  3. DocumentRoot            ::      /var/www/html

  4. ErrorLog                ::      /var/log/httpd/error_log

  5. AccessLog               ::      /var/log/httpd/access_log

  6. cgi-bin                 ::      /var/www/cgi-bin

  7. binary                  ::      /usr/sbin/httpd

  8. start/stop              ::      /sbin/service httpd

  9. {start|stop|restart|reload|graceful|condreload|closelogs|update|condrestart|status|extendedstatus|configtest|configtest_vhosts|semcleanrestart|debug|show_defines}

复制代码
Mac OS X (Leopard, Apache 2.2):
  1. ServerRoot              ::      /usr

  2. Primary Config Fle      ::      /etc/apache2/httpd.conf

  3. DocumentRoot            ::      /Library/WebServer/Documents

  4. ErrorLog                ::      /var/log/apache2/error_log

  5. AccessLog               ::      /var/log/apache2/access_log

  6. cgi-bin                 ::      /Library/WebServer/CGI-Executables (empty by default)

  7. binary                  ::      /usr/sbin/httpd

  8. 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

Mac OS X (Tiger and earlier, Apache 1.3):
  1. ServerRoot              ::      /usr

  2. Primary Config Fle      ::      /etc/httpd/httpd.conf

  3. DocumentRoot            ::      /Library/WebServer/Documents

  4. ErrorLog                ::      /var/log/httpd/error_log

  5. AccessLog               ::      /var/log/httpd/access_log

  6. cgi-bin                 ::      /Library/WebServer/CGI-Executables (empty by default)

  7. binary                  ::      /usr/sbin/httpd

  8. start/stop              ::      apachectl (start|stop|restart|fullstatus|status|graceful|configtest|help)

复制代码
NetBSD Apache 2.0 and 1.3 from pkgsrc (layout is identical):
  1. ServerRoot              ::      /usr/pkg

  2. Config File             ::      /usr/pkg/etc/httpd/httpd.conf

  3. DocumentRoot            ::      /usr/pkg/share/httpd/htdocs

  4. ErrorLog                ::      /var/log/httpd/error_log

  5. AccessLog               ::      /var/log/httpd/access_log

  6. cgi-bin                 ::      /usr/pkg/libexec/cgi-bin

  7. binaries (apachectl)    ::      /usr/pkg/sbin

  8. start/stop              ::      /etc/rc.d/apache [fast|force|one](start stop restart rcvar reload status poll)

  9. /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 2.2):
  1. ServerRoot              ::      /usr/local

  2. Config File             ::      /usr/local/etc/apache22/httpd.conf

  3. DocumentRoot            ::      /usr/local/www/apache22/data

  4. ErrorLog                ::      /var/log/httpd-error.log

  5. AccessLog               ::      /var/log/httpd-access.log

  6. cgi-bin                 ::      /usr/local/www/apache22/cgi-bin

  7. binaries (apachectl)    ::      /usr/local/sbin

  8. start/stop              ::      /usr/local/etc/rc.d/apache22.sh (start|restart|stop|reload|graceful|gracefulstop|configtest)

  9. /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 2.0):
  1. ServerRoot              ::      /usr/local

  2. Config File             ::      /usr/local/etc/apache2/httpd.conf

  3. DocumentRoot            ::      /usr/local/www/data

  4. ErrorLog                ::      /var/log/httpd-error.log

  5. AccessLog               ::      /var/log/httpd-access.log

  6. cgi-bin                 ::      /usr/local/www/cgi-bin

  7. binaries (apachectl)    ::      /usr/local/sbin

  8. start/stop              ::      /usr/local/etc/rc.d/apache2.sh [fast|force|one](start|restart|stop|reload|configtest|rcvar)

  9. /etc/rc.conf variables  ::      apache2_enable="YES"

复制代码
Notes:
Other variables to insert in rc.conf are listed in the comments at the top of the start/stop script

FreeBSD (Apache 1.3):
  1. ServerRoot              ::      /usr/local

  2. Config File             ::      /usr/local/etc/apache/httpd.conf

  3. DocumentRoot            ::      /usr/local/www/data

  4. ErrorLog                ::      /var/log/httpd-error.log

  5. AccessLog               ::      /var/log/httpd-access.log

  6. cgi-bin                 ::      /usr/local/www/cgi-bin

  7. binaries (apachectl)    ::      /usr/local/sbin

  8. start/stop              ::      /usr/local/etc/rc.d/apache.sh

  9. rc.conf variables       ::      apache_enable="YES"

  10. (other variables to insert in rc.conf are listed in the comments at the top of the start/stop script)

复制代码
Win32 (2.2):
  1. ServerRoot              ::      "C:/Program Files/Apache Software Foundation/Apache2.2"

  2. Config File             ::      "C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf"

  3. DocumentRoot            ::      "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

  4. ErrorLog                ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/error.log"

  5. AccessLog               ::      "C:/Program Files/Apache Software Foundation/Apache2.2/logs/access.log"

  6. cgi-bin                 ::      "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

  7. binaries (apachectl)    ::      "C:/Program Files/Apache Software Foundation/Apache2.2/bin"

复制代码
Notes:
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 2.0):
  1. ServerRoot              ::      /usr/apache2

  2. Config File             ::      /etc/apache2/httpd.conf

  3. DocumentRoot            ::      /var/apache2/htdocs

  4. ErrorLog                ::      /var/apache2/logs/error_log

  5. AccessLog               ::      /var/apache2/logs/access_log

  6. cgi-bin                 ::      /var/apache2/cgi-bin

  7. binaries                ::      /usr/apache2/bin

复制代码
Notes:
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.

Solaris 10 (Apache 1.3):
  1. ServerRoot              ::      /usr/apache

  2. Config File             ::      /etc/apache/httpd.conf

  3. DocumentRoot            ::      /var/apache/htdocs

  4. ErrorLog                ::      /var/apache/logs/error_log

  5. AccessLog               ::      /var/apache/logs/access_log

  6. cgi-bin                 ::      /var/apache/cgi-bin

  7. binaries                ::      /usr/apache/bin

  8. start/stop              ::      /etc/init.d/apache (start|startssl|sslstart|start-SSL|restart|stop)

复制代码
Notes:
1.Config needs to be copied from example file to httpd.conf.
2.Apache-1.3 is the default installation in /etc/init.d and /etc/rc3.d files. Also Apache Tomcat is included in 1.3 installation.

Slackware 10.1, 10.2 and 11.0 (Apache 1.3):
  1. ServerRoot              ::     /usr

  2. DocumentRoot            ::     /var/www/htdocs

  3. AccessLog               ::     /var/log/apache/access_log

  4. ErrorLog                ::     /var/log/apache/error_log

  5. binaries (apachectl)    ::     /usr/sbin

  6. modules                 ::     /usr/libexec/apache

  7. system startup script   ::     /etc/rc.d/rc.httpd (start|stop|restart|graceful)

  8. Apache config file      ::     /etc/apache/httpd.conf

  9. mod_ssl config file     ::     /etc/apache/mod_ssl.conf

  10. php config file         ::     /etc/apache/mod_php.conf

  11. cgi-bin                 ::     /var/www/cgi-bin

  12. on-line docs ("manual") ::     /var/www/htdocs/manual

  13. proxy cache             ::     /var/cache/proxy

复制代码
Slackware 12.0 (Apache 2.2):
  1. ServerRoot              ::     /usr

  2. DocumentRoot            ::     /svr/httpd/htdocs

  3. AccessLog               ::     /var/log/httpd/access_log

  4. ErrorLog                ::     /var/log/httpd/error_log

  5. binaries (apachectl)    ::     /usr/sbin

  6. modules                 ::     /usr/lib/httpd

  7. system startup script   ::     /etc/rc.d/rc.httpd (start|restart|graceful|graceful-stop|stop)

  8. Apache config file      ::     /etc/httpd/httpd.conf

  9. mod_ssl config file     ::     /etc/httpd/extra/httpd-ssl.conf

  10. php config file         ::     /etc/httpd/mod_php.conf

  11. cgi-bin                 ::     /svr/httpd/cgi-bin

  12. on-line docs ("manual") ::     /svr/httpd/htdocs/manual

复制代码
openSUSE and SLES (Apache 2.2):
  1. ServerRoot              ::      /srv/www

  2. DocumentRoot            ::      /srv/www/htdocs

  3. Apache Config File      ::      /etc/apache2/httpd.conf

  4. Other Config Files      ::      /etc/sysconfig/apache2

  5. SSL Config File         ::      /etc/apache2/ssl-global.conf

  6. ErrorLog                ::      /var/log/apache2/error_log

  7. AccessLog               ::      /var/log/apache2/access_log

  8. cgi-bin                 ::      /srv/www/cgi-bin

  9. binaries (apachectl)    ::      /usr/sbin

  10. 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.

Gentoo (Apache 2.2):
  1. ServerRoot              ::      /usr/lib/apache2

  2. DocumentRoot            ::      /var/www/localhost/htdocs

  3. Apache Config File      ::      /etc/apache2/httpd.conf

  4. Other Config Files      ::      /etc/conf.d/apache2

  5. Default VHost Config    ::      /etc/apache2/vhosts.d/00_default_vhost.conf

  6. Module Configuration    ::      /etc/apache2/modules.d

  7. Module Locations        ::      /usr/lib/apache2/modules

  8. ErrorLog                ::      /var/log/apache2/error_log

  9. AccessLog               ::      /var/log/apache2/access_log

  10. cgi-bin                 ::      /var/www/localhost/cgi-bin

  11. binaries (apache2ctl)   ::      /usr/sbin

  12. start/stop              ::      /etc/init.d/apache2 (start|restart|graceful|stop|configtest)