Richard
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 lines:
Group daemon
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. Next change the following line:
and change it into:
This will allow you to have php based index pages to appear without any problems.



Comments
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.
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.
7:56 pm
Hi
after installing the security update for Leopard (March 2010) apache isnt serving webpages anymore. it is still running and localhost brings up postfixadmin, but not remotely. Switching off the os x firewall completely solves teh problem but that is not something I feel comfortable with. httpd is added as an allow for ” set access” rule. I tried removing it from the list and re placing it in the firewall list. Anyone else have this problem? I am running apache 2.2.14 as 32 bit.
8:00 pm
I didn’t find any problems. But I must say I don’t use the default firewall configuration. I use noobproof to configure the standard firewall, I can configure it a lot better with that tool.
8:02 pm
Follow up: In the knowledge base on the security update (http://support.apple.com/kb/HT4077) it is noted that firewall rules might become inactive.
4:34 pm
An upgrade of Snow Leopard caused my apachectl (start, stop, restart) script to stop working and throwing the error msg: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
Had to look for the line in apachectl: ULIMIT_MAX_FILES=”ulimit -S -n `ulimit -H -n`”
Changing that line as follows fixed the problem:
ULIMIT_MAX_FILES=”"