Categories
Mac

Where are the Apache Configuration files on Mac? – httpd.conf

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:

  1. In the Finder, click the Go menu, and choose Go to Folder…
  2. Type in /etc/apache2.
  3. 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:

  1. Go to the Apple menu and choose System Preferences.
  2. Click on Sharing.
  3. Untick Web Sharing.
  4. Tick Web Sharing.
Categories
Ubuntu

Httpd.conf – What’s its Location on Ubuntu?

Here’s where to find the Apache 2 web server configuration file httpd.conf on Ubuntu.

Did you know that on Ubuntu, the main Apache configuration file is not httpd.conf? The main Apache config file is actually apache2.conf.

When Apache 2 reads apache2.conf, the contents of httpd.conf is included by an include directive in apache2.conf. Here’s the lines from apache2.conf that include httpd.conf:

# Include all the user configurations:
Include /etc/apache2/httpd.conf

So use httpd.conf on Ubuntu is specifically for your servers specific configuration. You may still need to want to edit apache2.conf at times, to change Apache’s configuration rather than add to it.

Httpd.conf Location

On Ubuntu, httpd.conf is located in the directory /etc/apache2. apache2.conf is also located in /etc/apache2.

Httpd.conf Location for Specific Ubuntu Versions

To ensure these locations are accurate, I’ve checked httpd.conf’s location on a number of different Ubuntu versions. The definitive article is Where is Httpd.conf’s Location on Ubuntu? at Ubuntu Gods.

Ubuntu Version httpd.conf Location
Ubuntu 7.04 Feisty Fawn /etc/apache2/httpd.conf
Ubuntu 8.10 Intrepid Ibex /etc/apache2/httpd.conf
Ubuntu 10.10 Maverick Meerkat /etc/apache2/httpd.conf

Additions & refinements welcome!

Categories
Apache

Httpd.conf’s Location on CentOS, Ubuntu, Red Hat, Mac and Others

Here’s where to find the Apache 2 web server configuration file httpd.conf The httpd.conf directory differs across Linux & Unix variants like CentOS, Mac OS X, Red Hat, Ubuntu and XAMPP Mac.

This table lists the httpd.conf location for each operating system:

Operating System / Linux Distro httpd.conf Location
CentOS 5.2 /etc/httpd/conf/httpd.conf
CentOS 5.3 /etc/httpd/conf/httpd.conf
Mac OSX 10.6 Snow Leopard /etc/apache2/httpd.conf
Mac OSX 10.7 Lion /etc/apache2/httpd.conf
Red Hat Enterprise Linux Server 5.6 Tikanga (RHEL) /etc/httpd/conf/httpd.conf
Ubuntu 7.04 Feisty Fawn /etc/apache2/httpd.conf
Ubuntu 8.10 Intrepid Ibex /etc/apache2/httpd.conf
Ubuntu 10.10 Maverick Meerkat /etc/apache2/httpd.conf
XAMPP on Mac /Applications/XAMPP/etc/httpd.conf

For more specific information on Ubuntu, see httpd.conf location on Ubuntu.

The location for Fedora will likely be the same as CentOS (same distro family).

The location for Debian will likely be the same as Ubuntu (same distro family).

If your operating system or Apache package isn’t mentioned here, you can use the find command on Linux, Unix or Mac to find httpd.conf, e.g.:

find / -name httpd.conf 2>/dev/null

On Windows, you can use the search facility of Windows Explorer to find httpd.conf.

Additions & refinements welcome!