![]() |
Apache2 (WebSharing) Failed To Connect
All of a sudden, my Apache 2 cannot be connected to. It is enabled in system preferences, and I've made no changes other than the necessary ones (enable PHP and change access port).
I thought the problem was after installing Darwin Streaming Server, so I uninstalled everything according to a guide I followed, but even now it's still not working. I checked /etc/hostconfig, and it says WEBSERVER=-NO-, which is what it's supposed to be after having a friend test it on his system. Any way to fix this or reinstall the websharing? I mounted the DVD I used to install, and opened it up with Pacifist. I dug down to the apache2 part and installed that again. Rebooted, no joy. This sucks, because I used my apache all the time for things. Everything else works though, FTP, SSH, everything. |
Is it actually running? (ps -ef|grep apache)
If so, is it listening to the port you expect? (netstat -a|grep http for default port 80) What are the logs saying (typically located in /var/log/Apache/)? Any errors? |
Code:
[harataiki@Shadow-of-Intent ~]# ps -ef | grep apache Code:
2/5/09 1:53:47 AM com.apple.launchd[1] (org.apache.httpd) Throttling respawn: Will start in 10 seconds |
Your Apache is not running, so it is not surprising you cannot connect. :)
According to your logs, there is a problem with your logfiles and/or log directory. Check if your log directory /private/var/log/apache2 excists, and if there is a error_log and access_log. If there are, probably the permissions are incorrect. Most likely, the directory and/or logfiles are owned by root, and the Apache server is starting under user www. If the directory ownership is not www (ls -la to check), then do a "chown -R www:www /private/var/log/apache2" and try to start apache again. HTH |
I don't see the dir:
Code:
[harataiki@Shadow-of-Intent ~]# ls /private/var/log/ |
Just do a mkdir /private/var/log/apache2 and chown -R www:www /private/var/log/apache2 and you should be set; Apache will create its logfiles when it starts up.
|
Thank you, that got it working again.
Any reason it got borked, though? I don't mess with the logs so I don't know why how they were messed with. |
I have no idea. :) Computers are weird sometimes. Maybe you had a crash at some point, and the disk check upon next boot removed it.
Glad to have been of help. As a former unix admin, this stuff is a lot easier for me than getting my WiFi running under OSX. ;) |