Work with Apache

Apache is the open source HTTP web server provided with OS X Server. You can use the Server app to manage web service and use the default Apache settings. To change advanced Apache settings, edit Apache configuration files and change or add Apache modules.

The locations of key Apache files and folders are listed in the following table.

File or folder

Location

Web service configuration files

/Library/Server/web/config/apache2/

Main web service configuration file

/Library/Server/web/config/apache2/httpd_server_app.conf

Website configuration files

/Library/Server/web/config/apache2/sites/

Template for new websites created in the Server app

/Library/Server/web/config/apache2/sites_disabled/0000_default_default.conf

Web app configuration files (webapp.plists)

/Library/Server/web/config/apache2/webapps/

Executable file

/usr/sbin/httpd

Apache plug-in modules

/usr/libexec/apache2/

/Applications/Server.app/Contents/ServerRoot/usr/libexec/apache2/

Error log

/var/log/apache2/ (with a symlink that lets the folder be viewed as /Library/Logs/WebServer/)

Temporarily disabled websites

/Library/Server/web/config/apache2/sites_disabled/

Static content

/Library/Server/Web/Data/Sites/Default/ (default)

CGI files

/Library/WebServer/CGI-Executables/

Files in /Library/Server/web/config/apache2/sites/ are read and processed by Apache when it performs a restart. You disable sites by deleting them from the web panel of the Server app.

Each time you save changes the web server restarts, if it’s running. The web app mechanism eliminates the need to edit website config files using a text editor. If for some reason you do need to edit the config files using a text editor, follow the guidelines at the top of the file and make sure your text editor doesn’t leave any temporary files inthe folder.

For information about important Apache configuration files, see the ReadMe.txt file in /Library/Server/web/config/apache2/. For Apache web server v2.2 documentation, see http://httpd.apache.org/docs/2.2/.

For information about web application configuration files, enter man webapp.plist in Terminal.