httpd.conf file location

A previous question asked where this file is. I have to say that the Apple support answer recommending they back up the file was completely unhelpful. I am hoping to answer this question or get feedback on the possible answers. I am using Mac High Sierra 13.0 because this is a company computer and I'm not allowed to upgrade. I am installing a Drupal/Amp type environment. The notes I am following tell me that the document root for this can be set either at system or user level. Another product created an install under my username /sites so I started there as the location for user level install. To make it clear, this is at "Macintosh HD/Users/<myusername>/Sites/etc/apache2/. Some of these folders did not exist. The online advice I am following said that the httpd.conf folder would be in that location but it was not. I do find an httpd.conf folder at Macintosh HD/private/etc/apache2/

Where should we find this httpd.conf folder?

If indeed there is a user/system version- can someone answer where each one would be?

If this changes in newer versions of the Mac OS, where would we find those locations?


MacBook

Posted on Sep 23, 2019 4:17 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 23, 2019 4:55 PM

To make it clear, this is at "Macintosh HD/Users/<myusername>/Sites/etc/apache2/.

You are completely off on the wrong foot. There is not a "user" server. There are user Sites which would run as a sub-site to your main web site. ~/Users/user/Sites is the DocumentRoot for that user. The DocumentRoot for the main site is in /Library/WebServer/Documents (or you can change it).


You don't put server configuration files in the DocumentRoot. You put all of the web site files in there, like index.html.

The server config is at /etc/apache2/httpd.conf.


9 replies
Question marked as Top-ranking reply

Sep 23, 2019 4:55 PM in response to westred

To make it clear, this is at "Macintosh HD/Users/<myusername>/Sites/etc/apache2/.

You are completely off on the wrong foot. There is not a "user" server. There are user Sites which would run as a sub-site to your main web site. ~/Users/user/Sites is the DocumentRoot for that user. The DocumentRoot for the main site is in /Library/WebServer/Documents (or you can change it).


You don't put server configuration files in the DocumentRoot. You put all of the web site files in there, like index.html.

The server config is at /etc/apache2/httpd.conf.


Sep 24, 2019 3:14 PM in response to westred

I'm not sure if your response is meant for me, since I never said server or "user" server in my question.

No, but you attempted to make a server in the user document root. You seem to want to put the config files (/etc/apache2) into the user's document root. That is not correct (but I repeat myself).


We all have told you were the default configuration and HTML files belong (/etc/apach2).

You seem to be choosing to ignore the advice we are giving.

The answers to all of your questions are given, several times. BobHarris even gave you a complete directory dump of the config files.

Sep 23, 2019 4:30 PM in response to westred

/bin/ls -dleO@ /etc/apache2/*
drwxr-xr-x  35 root  wheel  -           1120 Apr 27 11:12 /etc/apache2/extra
-rw-r--r--   1 root  wheel  -          21150 Apr 27 11:02 /etc/apache2/httpd.conf
-rw-r--r--   1 root  wheel  compressed 20785 Aug 22  2015 /etc/apache2/httpd.conf.pre-update
-rw-r--r--   1 root  wheel  -          20837 Jan  9  2017 /etc/apache2/httpd.conf~previous
-rw-r--r--   1 root  wheel  compressed 13077 Aug 17  2018 /etc/apache2/magic
-rw-r--r--   1 root  wheel  compressed 61118 Aug 17  2018 /etc/apache2/mime.types
drwxr-xr-x   4 root  wheel  -            128 Aug 17  2018 /etc/apache2/original
drwxr-xr-x   3 root  wheel  -             96 Aug 17  2018 /etc/apache2/other
drwxr-xr-x   7 root  wheel  -            224 Sep 16 11:25 /etc/apache2/users


If you want to find it via the Finder

Finder -> Go -> Go to Folder -> /etc/apache2


You will need the 'sudo' command to edit httpd.conf, as it is owned by 'root'


And you may want to know about

sudo apachectl start
sudo apachectl stop

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

httpd.conf file location

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.