Apache2 doesn't work on my new Mac Snow Leopard installation (Mac OS X 10.6.4)

若如初见. 提交于 2019-12-11 15:27:45

问题


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 that 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...


回答1:


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.




回答2:


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/


来源:https://stackoverflow.com/questions/4008804/apache2-doesnt-work-on-my-new-mac-snow-leopard-installation-mac-os-x-10-6-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!