You are not logged in.

#1 2013-02-04 20:09:19

xworld
Member
Registered: 2012-05-27
Posts: 153

Apache Won't Start

Hello. The title pretty much says it all. It was working absolutely fine when suddenly it Failed to start on boot. I did as it said and checked systemctl status and got this error:

httpd.service - Apache Web Server
	  Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
	  Active: failed (Result: exit-code) since Mon 2013-02-04 13:52:41 UTC; 12min ago
	 Process: 386 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Feb 04 13:52:41 machine apachectl[386]: [Mon Feb 04 13:52:41 2013] [warn] module php5_module is a...ping
Feb 04 13:52:41 machine apachectl[386]: [Mon Feb 04 13:52:41 2013] [crit] (EAI 9)Address family f....0.1
Feb 04 13:52:41 machine apachectl[386]: Syntax error on line 41 of /etc/httpd/conf/httpd.conf:
Feb 04 13:52:41 machine apachectl[386]: Listen setup failed
Feb 04 13:52:41 machine systemd[1]: httpd.service: control process exited, code=exited status=1
Feb 04 13:52:41 machine systemd[1]: Failed to start Apache Web Server.
Feb 04 13:52:41 machine systemd[1]: Unit httpd.service entered failed state

I noticed that it said there was a syntax error on line 41. I went to check but there seems to be no syntax error at all. Why would there be anyway I haven't edited this file in quite a long time. Here's the line anyway.

Listen 127.0.0.1:80

I see nothing wrong with that. This seems to have come out of nowwhere. The only thing I've done recently is create a network connect .service file:

[Install]
Description=Network Connectivity
WantedBy=network.target
Before=network.target

[Service]
type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash /home/user/path/to/connect.sh

[Install]
WantedBy=multi-user.target

The systemctl enable network.service and rebooted. They seem to be connected but I'm not sure why.

EDIT: That's rather odd. I went to view the logs in /var/log/httpd/error_log and saw some errors like this:

[Mon Feb 04 15:47:54 2013] [error] [client 127.0.0.1] File does not exist: /home/user/code/php/favicon.ico
[Mon Feb 04 15:47:54 2013] [error] [client 127.0.0.1] File does not exist: /home/user/code/php/favicon.ico

Anyway, after emptying the log file and restarting it worked. 0.o

I'm not sure why that worked but it did. I don't know if that was the best solution though considering I didn't actually figure out what was wrong. Hopefully it stays working.

EDIT 2: Well, as expected that wasn't a good fix at all. The next reboot failed to start Apache again. Here's the most recent errors in /var/log/httpd/error_log:

[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
[Mon Feb 04 17:16:17 2013] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)

I had noticed that popping up quite a bit before. I have no idea what it means though. Is it possible this is a bug? I noticed that I am able to fix this by simply stopping and starting the service after startup. I'd rather just have it work though.

Last edited by xworld (2013-02-05 21:29:42)

Offline

Board footer

Powered by FluxBB