I've installed snow leopard on the old tiger and I tried to run apache2 by clicking system preferences->sharing->web sharing. It seems to run but if I try to access http://localhost or http://127.0.0.1 or http://192.168.1.6/ (my ip on my network) it doesn't work. I don't know where is the log file (no files on /private/var/log/apache2/). I've seen t开发者_JS百科hat the port in /etc/httpd.conf is 80. But I cannot see the process on Activity Monitoring panel: there is not any httpd or apache process running...
This may not be the answer you are looking for, but MAMP seems to run relatively well for me.
You can also try
sudo apachectl start
from the command line.
I think you will find a detailed answer to your question at this URL:
http://shapeshed.com/journal/setting_up_local_websites_on_snow_leopard/
The "trick" is this line, ... which stops and then restarts apache,
sudo apachectl restart
This forces apache2 to read any changes you've made to config files.
Also, check to make sure you are using the right config file. Under Mac OS X 10.6.4, my config files seem to be here:
/etc/apache2/httpd.conf
Logs files are found here:
/var/log/apache2/access_log
This should get you up and running, ... but I would also recommend looking into using MAMP, which is a pre-packaged Mac+Apache2+MySQL+PHP5 stack that you can get up and running very quickly.
http://www.mamp.info/
精彩评论