When I view the "Websites" section in the OSX Server app, I am able to manage what appear to be virtual hosts. However, when I go to check Apache's vhosts configuration, there doesn't seem to be anything configured. Is there some kind of magic going on here, or are the changes made via the Server app affecting files somewhere else? Can anyone shed some light on how OS X manages the built in Apache installation?
Asked
Active
Viewed 5,073 times
2 Answers
9
Since you mention Server App, I assume your OS X is Mountain Lion. The actual apache config is at the following location
/Library/Server/Web/Config/apache2/
Virtual host config is in
/Library/Server/Web/Config/apache2/sites
You are probably looking at /private/etc/apache2/
or /etc/apache2/
, which is not being used.

John Gardeniers
- 27,458
- 12
- 55
- 109

John Siu
- 3,667
- 2
- 17
- 23
-
1Weird - in my case the /private/etc/apache2/httpd.conf *is* being used (I made some changes, added a module) and the module is now loading and those changes are reflected. Could it be using both somehow (doesn't make sense, but can't think of a better explanation)? – Wilco Nov 07 '12 at 17:52
-
Depends on if the **include** statement(s) in **/Library/Server/Web/Config/apache2/httpd_server_app.conf** pointing to the other directory is/are enabled. In Mountain Lion, by default httpd_server_app.conf only include the language config from /private/etc/apache2. Maybe you enabled extra lines long time ago. Additionally, Apple keep changing the underline configuration and file location from version to version. – John Siu Nov 07 '12 at 19:36
0
It's worth mentioning that the configuration files for the default sites in macOS Server (HTTP, port 80, and HTTPS, port 443) are located here:
/Library/Server/Web/Config/apache2/sites/0000_127.0.0.1_34580_.conf
/Library/Server/Web/Config/apache2/sites/0000_127.0.0.1_34543_.conf
On my Mac mini, there are files for 80 and 443 but they are not used.

Glorfindel
- 1,213
- 4
- 15
- 22