Here’s where to find httpd.conf
on Mac. This is the httpd.conf location on Mac OS X 10.6 Snow Leopard and Mac OS X 10.7 Lion. This article also shows how to make the httpd.conf directory visible in the Mac Finder.
What is Httpd.conf?
Httpd.conf is the Apache web server’s main configuration file. Mac OSX ships with Apache installed. See Apache’s configuration docs for how to configure Apache.
Httpd.conf Location on Mac
On Mac httpd.conf location is in the directory /etc/apache2
. You can access this folder through the Mac Finder or through the Mac Terminal.
Checked on OS X 10.7, 10.6.8, 10.6.7.
Httpd.conf Location in Mac Finder
You won’t normally see even the /etc/apache2
directory showing up in the Mac Finder. I tried looking in Macintosh
HD
, but /etc doesn’t show up.)
I found a tip at Codejacked on how to open hidden files in the Finder.
Here’s how to view httpd.conf’s directory in the Mac’s finder:
- In the Finder, click the Go menu, and choose Go to Folder…
- Type in
/etc/apache2
. - Click Go.
The Finder will show the apache2
folder, and in it, you’ll see httpd.conf.
Httpd.conf Location in Mac Terminal
You can also get to the httpd.conf file through a terminal session, which is okay if your comfortable in the Unix shell (bash
):
tazpro:~ taz$ cd /etc/apache2 tazpro:apache2 taz$ ls extra magic original users httpd.conf mime.types other
Can’t Save Httpd.conf?
Httpd.conf is protected by OSX from being edited. If you open it with the TextEdit application for example, you won’t be able to save it. For details to bypass this security, see How to Easily Edit Httpd.conf on Mac.
Restart Apache to Apply Configuration Changes
Don’t forget you will need to restart Apache for your configuration changes in httpd.conf to be applied. To restart Apache on Mac:
- Go to the Apple menu and choose System Preferences.
- Click on Sharing.
- Untick Web Sharing.
- Tick Web Sharing.