Working with the Apache configuration file

Ask questions Research chat →

https://www.phusionpassenger.com/library/install/apache/working_with_the_apache_config_file.html · scraped

deploy

Attachments

Scraped Content

— 279 words · 2026-02-14 17:41:12 UTC ·

Excerpt

## The location of the Apache configuration file On most systems if you installed Apache with a package manager, or it came preinstalled, the Apache configuration file is located in one of these locations: - /etc/apache2/httpd.conf - /etc/apache2/apache2.conf - /etc/httpd/httpd.conf - /etc/httpd/conf/httpd.conf If you installed Apache from source it is likely located in /usr/local or /opt, though the config files may have been moved to /etc as usual. Check your build script for more details. Furthermore On macOS Server >= 10.8 Mountain Lion, the location of the Apache configuration file varies. Some paths are listed below, please refer to the macOS Server documentation for complete information. | Not using websites/webservices | default (/etc/apache2/httpd.conf) | | macOS Server 4 webservices | /Library/Server/Web/Config/apache2/httpd_server_app.conf | | macOS Server 5 websites | /Library/Server/Web/Config/apache2/server-httpd.conf | ## mods-enabled and sites-enabled To allo
## The location of the Apache configuration file On most systems if you installed Apache with a package manager, or it came preinstalled, the Apache configuration file is located in one of these locations: - /etc/apache2/httpd.conf - /etc/apache2/apache2.conf - /etc/httpd/httpd.conf - /etc/httpd/conf/httpd.conf If you installed Apache from source it is likely located in /usr/local or /opt, though the config files may have been moved to /etc as usual. Check your build script for more details. Furthermore On macOS Server >= 10.8 Mountain Lion, the location of the Apache configuration file varies. Some paths are listed below, please refer to the macOS Server documentation for complete information. | Not using websites/webservices | default (/etc/apache2/httpd.conf) | | macOS Server 4 webservices | /Library/Server/Web/Config/apache2/httpd_server_app.conf | | macOS Server 5 websites | /Library/Server/Web/Config/apache2/server-httpd.conf | ## mods-enabled and sites-enabled To allow better organization, many operating systems and Apache distributions also read configuration files in the conf.d, mods-enabled and sites-enabled subdirectories. mods-enabled contains symlinks to files in mods-available. This latter subdirectory contains config files for all available modules, while mods-enabled contains only a subset, namely the modules that should actually be enabled. The symlinks are created using the a2enmod tool. *.load files contain LoadModule directives, while *.conf files contain all other configuration directives. ## Storing Passenger configuration snippets If you can, you should use mods-enabled/mods-available to store Passenger configuration. Assuming that your Apache configuration directory is /etc/apache2: - Create /etc/apache2/mods-available/passenger.load and paste the LoadModule ... directive that passenger-install-apache2-module outputs. - Create /etc/apache2/mods-available/passenger.conf and paste the PassengerRoot and other Passenger options. - Enable by running sudo a2enmod passenger. If the mods-enabled mechanism is not available then you can paste configuration snippets into httpd.conf or apache2.conf directly.

Visibility

Visible to everyone

Reading Status

Related Bookmarks

My Note


Saved!

Annotations

Export as Markdown
+ Annotate selection

Add Annotation