apache start error - httpd dead but subsys locked

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
bertsmilsky
Forum Newbie
Posts: 13
Joined: Fri Jul 18, 2008 10:23 am

apache start error - httpd dead but subsys locked

Post by bertsmilsky »

Hi,

I have just installed apache on Centos and the server started fine, 'service httpd status' was ok. the browser work.

i tried to restart 'service httpd restart' after changing the config file and stopping "FAILED" and starting "OK". when i look for httpd processes 'ps -aux | grep httpd' nothing appears, and localhost in the browser shows "failed to connect". 'service httpd status' returns "httpd dead but subsys locked".

In the error_log it says:
[Mon Mar 02 13:19:33 2009] [notice] SELinux policy enabled; httpd running as context root:system_r:httpd_t:s0
[Mon Mar 02 13:19:33 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Mar 02 13:19:33 2009] [notice] Digest: generating secret for digest authentication ...
[Mon Mar 02 13:19:33 2009] [notice] Digest: done
[Mon Mar 02 13:19:34 2009] [warn] pid file /etc/httpd/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Mar 02 13:19:34 2009] [error] (13)Permission denied: could not create /etc/httpd/logs/httpd.pid
[Mon Mar 02 13:19:34 2009] [error] httpd: could not log pid to file /etc/httpd/logs/httpd.pid

i have been searching for answers and some people say delete the /var/run/httpd.pid file. i did that but still it wont work. i have also tried deleting the /var/locl/subsys/httpd file and this does not work. strangley the only way i can get apache to work is if i type 'httpd -X' but i am not sure what this doing.

i cant find any other advise on the net. any ideas?
bertsmilsky
Forum Newbie
Posts: 13
Joined: Fri Jul 18, 2008 10:23 am

Re: apache start error - httpd dead but subsys locked

Post by bertsmilsky »

i have added the following links:

ln -s /etc/init.d/apachectl /etc/rc3.d/S90apache

ln -s /etc/init.d/apachectl /etc/rc2.d/K90apache
ln -s /etc/init.d/apachectl /etc/rc1.d/K90apache
ln -s /etc/init.d/apachectl /etc/rc0.d/K90apache

now as long as i delete the /etc/httpd/logs/http.pid file before each start it works.

if it try and stop it i get the following error:
(20014)Internal error: Error retrieving pid file logs/httpd.pid
Remove it before continuing if it is corrupted.

if i try and restart i get:
(20014)Internal error: Error retrieving pid file logs/httpd.pid
Remove it before continuing if it is corrupted.

i then have to delete the httpd.pid file before i start and it works. any ideas what the problem is?

thanks
IceTheNet
Forum Newbie
Posts: 2
Joined: Thu Sep 08, 2011 9:11 pm

Re: apache start error - httpd dead but subsys locked

Post by IceTheNet »

OK I had this same problem it has to do with permissions the Apache server is registered under a new install to root. so in terminal you have to change to su to start the server. I also chown the etc/httpd folder
Post Reply