I thought the apache config files were stored in /etc/apache2. Yet if I remove the /etc/apache2 directory and run a sudo /usr/sbin/apachectl start the web server runs and serves up pages.

Is there another set of config files?

  • Are you using the Server.app version of apache? If so, it does things completely differently (see my answer to [this question(serverfault.com/questions/562983/…)). – Gordon Davisson Apr 16 '14 at 21:45
  • I'm not sure what version I am using. I believe I am using the one that came with the OS. ALso, there are no /Library/Server or /Applications/Server.app directories on my box... – ngramsky Apr 16 '14 at 22:00

At least on my system (OS X 10.9.2), I see that apache is going to use /private/etc/apache2. Note SERVER_CONFIG_FILE below:

$ sudo /usr/sbin/apachectl -V
Server version: Apache/2.2.26 (Unix)
Server built:   Dec 10 2013 22:09:38
Server's Module Magic Number: 20051115:33
Server loaded:  APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

Normally /etc is a symlink to /private/etc, but if it isn't on your system, that may explain the discrepancy.

| improve this answer | |
  • /etc is symlinked to /private/etc on my system... – ngramsky Apr 16 '14 at 21:08

A good way to find out this is to use the command :

apachectl -t -D DUMP_INCLUDES

Which will output something like

Included configuration files: (*) /usr/local/etc/httpd/httpd.conf

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .