Note: These instructions are identical for Leopard and Snow Leopard.
The are some items you need to change in the default configuration to allow other parts of this documentation to work witouth to many problems and to keep your server a bit more secure.
You need to change the configuration file of Apache. Please edit the file ‘httpd.conf‘ in the directory ‘/etc/httpd/‘. Find the following line:
and change it into:
This will allow you to have php based index pages to appear without any problems. Next change the following lines:
Group #-1
and change them into:
Group _www
This will run the Apache process (httpd) as a normal user on your system, the _www user hasn’t got many rights but enough to run a web-server. This makes the system more secure.
The next change is to allow the use of ‘.htaccess‘ files in your directories and virtual sites. Find the lines:
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
Edit the line below from:
and change it into:
Next step: Configuring virtual hosts in Apache



11:37 pm
My httpd.conf is in /etc/apache2, not /etc/httpd.
7:31 am
Samantha, you are correct for configuring the default Apache installation. However we are configuring the newly installed and self compiled Apache installation from the previous pages. Therefore you comment isn’t relevant.
8:57 pm
Hey – got a bit of a problem. When I look into the /etc/httpd/ directory, all I see is “httpd.conf.save”. I try to open it with TextEdit but it says I don’t have privileges. I also tried Pico in Terminal but all I get is a blank page. Could you help me please?
8:23 am
@Elliot, did you compile and install using my instructions? If you are configuring the default Apache installation that config file is in /etc/apache2.
6:21 pm
hello, i am extremely new to apache. I have installed apache (I think) and need to configure it. When you say “Please edit the file
7:07 pm
Matthew you can edit the file with vi or with nano, but because they are protected for editing you have to use the sudo command to edit them as root.
`sudo vi /etc/httpd/httpd.conf`
or
`sudo nano /etc/httpd/httpd.conf`
4:34 am
Hello,
my installation has gone smooth up until now. I am about to change the line
DirectoryIndex index.html index.html.var
to
DirectoryIndex index.php index.html index.html.var
in my http.conf file; however, I do not have a line like
DirectoryIndex index.html index.html.var
I do have lines like
DirectoryIndex index.html
and
DirectoryIndex index.html index.php
Am I to edit one of these instead?
Also, lines
User nobody
Group #-1
are already changed to
User www
Group www
do I still need to change them to
User _www
Group _www
?
6:08 am
@Chase, if you are using Tiger then the user/group combo should be “www”, if you are on Leopard it should be “_www”.
As for the DirectoryIndex, yes change them all just to be on the safe side. If it works you could remove some of them to see what happens and learn from that.
1:10 am
Hi,
I’ve compiled apache like you instructed using the Darwin layout.
After make install I can’t find the /etc/httpd folder.
$locate httpd.conf (after locate.updatedb) tells me the following paths:
/private/etc/apache2/httpd.conf
/private/etc/apache2/httpd.conf.226
/private/etc/apache2/original/httpd.conf
What went wrong?
7:54 pm
@ashiso, because you used the Darwin layout your use of the directories is different. You need to use the original configuration directory as where you found it. So in your case /etc/apache2/ is the correct location.
11:56 pm
OK thanks!
4:41 pm
I also installed the darwin installation, but when I update the httpd.conf file at /etc/httpd.conf and restart the server in /usr/local/apache2/bin with ./apachectl restart or (stop then start) it doesn’t seem to be picking up any of my changes. Any idea what’s going on?
6:49 pm
Please note if you use the Darwin layout all the other stuff in this site may not work as it is based on the DIYMacServer layout.
In the Darwin layout the httpd.conf is located in /etc/apache2/ and apachectl is in /usr/sbin
3:21 pm
Hi,
I was wondering, is there an easy way to know if the apache (DIY) is running. I tried to start through Web Sharing (system preferences) and there it worked. I know this is the original Apache and not the DIY version.
So far no luck in starting the DIY version and reach my server even locally.
Thanks for any help
6:40 pm
Luc, Yes there is, use the command:
`ps -ax | grep http`
In the output is should tell you which httpd process is running.
`0:13.34 /usr/local/apache2/bin/httpd -k start`
7:26 pm
Hi Richard,
I started the httpd DIY version (sudo launchctl start com.diymacserver.apache2) but when I used your command I got following output :
macs-mac-mini:~ mac$ ps -ax | grep http
1062 ttys001 0:00.00 grep http
Any clue ?
And could you verify the Hosts i sent you ?
Thanks
5:00 am
This means that apache is not running at all. That output is just listing the grep process that you just ran to get the result. If apache were running you would get additional line(s) indicating the full path of the httpd binary.
9:54 pm
Hi Richard,
Thanks for the great website. I don’t understand why when I start apachectl from /usr/local/apache2/bin
how do I change the alias? its pointing to incorrech apachectl
sh-3.2# pwd
/usr/local/apache2/bin
sh-3.2# which apachectl
/usr/sbin/apachectl
Thanks Mario
1:03 am
Mario, you can create your own alias if you want to. We don’t do that as it might interfere with apple’s setup and apple might change apache with a software update. So always use /usr/local/apache2/bin/apachectl. You could also add /usr/local/apache2/bin to the PATH variable in bash before /usr/sbin.