Service httpd status: httpd dead but subsys locked, but pid exists

While I check the status of the apache service, I get this:

# service httpd status
httpd dead but subsys locked


1) Kill all the Apache process

# ipcs -s apache  (looking for  the locked PIDs of apache)

# ipcs -s | grep apache | perl -e ‘while (<STDIN>) { @a=split(/s+/);print `ipcrm sem $a[1]`}’ (deleting the resources)

# cd /var/lock/subsys ( deleting the lock from the subsys folder)

# rm httpd

# service httpd restart

2) If the above is not fixing then try the following.

Comment out the following module in your httpd.conf and restart apache

# LoadModule unique_id_module modules/

# /etc/init.d/httpd restart