Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Web server

I had a fatal hard drive error and had the hard drive replaced; then I restored from a Time Machine backup. Since then my web server won't serve. I get the following responses in Terminal:

JohnsWorkiMacG5:~ jfowler3$ /usr/sbin/apachectl configtest
Syntax OK
JohnsWorkiMacG5:~ jfowler3$ /usr/sbin/apachectl -k restart
httpd not running, trying to start
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
JohnsWorkiMacG5:~ jfowler3$ sudo /usr/sbin/apachectl -k restart
Password:
httpd not running, trying to start
(2)No such file or directory: httpd: could not open error log file /private/var/log/apache2/error_log.
Unable to open logs
JohnsWorkiMacG5:~ jfowler3$

The response to configtest should indicate the webserver is up.
The response to -k restart suggests a permissions problem.
So I used sudo and gave the correct password.
I don't know how to interp the last part.

Can anybody suggest what is the problem with my web server?
Thanks.

JF

iMac G5, Mac OS X (10.5.8)

Posted on Mar 29, 2010 7:59 AM

Reply
Question marked as Best reply

Posted on Mar 29, 2010 6:21 PM

Hi John,

You can't start Apache without sudo, so that's why the first try wouldn't go (permission denied).

Out of curiosity, have you looked to make sure you have a /private/var/log/apache2 directory? Perhaps that didn't get copied back across: that could account for the message on the second try where you did use sudo. If you have to create it, it's owned by root:wheel on my system.

charlie
3 replies
Question marked as Best reply

Mar 29, 2010 6:21 PM in response to John W Fowler Jr

Hi John,

You can't start Apache without sudo, so that's why the first try wouldn't go (permission denied).

Out of curiosity, have you looked to make sure you have a /private/var/log/apache2 directory? Perhaps that didn't get copied back across: that could account for the message on the second try where you did use sudo. If you have to create it, it's owned by root:wheel on my system.

charlie

Mar 30, 2010 6:41 AM in response to Charles Minow

While I don't understand why the GUI method in System Preferences wouldn't restart apache, doing a -k restart using sudo after creating directory /private/var/log/apache2/ (using sudo mkdir) did work. I wonder why this directory wouldn't have been restored from the Time Machine backup - maybe special permissions are required - but there should be some sort of notice in the System Preferences when selecting the Web Sharing checkbox doesn't work. At this time my webserver is back up. Thanks.

John F

Mar 31, 2010 6:20 AM in response to John W Fowler Jr

Hi John,

Glad to hear you got it sorted out.

John W Fowler Jr wrote:
I wonder why this directory wouldn't have been restored from the Time Machine backup - maybe special permissions are required


Time Machine doesn't appear to back up anything in the /private/var/log directory. Not even the sub-directory structure without the files. So there wasn't anything to restore.

there should be some sort of notice in the System Preferences when selecting the Web Sharing checkbox doesn't work. At this time my webserver is back up.


Yeah, System Preferences has never been very good about detecting problems with Web Sharing. I just watch the output in the logs in the Console app. That seems to work really well.

charlie

Web server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.