Knowledgebase

Confused - How to kill Apache?

Posted by webdesign jr, 04-19-2009, 06:02 AM
Hello. This morning apache stopped to serve pages. I have tried to restart it with no success: ------- init.d/httpd restart ---------- init.d/httpd stop killall httpd init.d/httpd start ------ killall httpd init.d/httpd restart --------- such like several times every time failed with the address already in use message Was 4 oclock in the morning su I stopped investigating and restarted the machine Is there a way to really shut down such a completely non-responsive process withou restarting the machine?? just a notice - there were not a heavy server load at the time Thanks a lot. ------------------ Server Version: Apache/2.2.6 (Mandriva Linux/PREFORK-8.2mdv2008.0) mod_ssl/2.2.6 OpenSSL/0.9.8e PHP/5.2.4 with Suhosin-Patch Server Built: Sep 12 2008 14:54:18

Posted by serveradmin4u, 04-19-2009, 07:17 AM
Hi, You need to figure out why apache fails. You may get the details like why it's failing from /etc/httpd/logs/error_log file Also In order to kill apache/httpd process you may use the command pkill httpd then restart the service using /etc/rc.d/init.d/httpd start Serveradmin4u

Posted by ServerManagement, 04-19-2009, 08:28 AM
You have to check the ports and processes to see what else is running on it. It can be an http process stuck or something else that grabbed the port.

Posted by Syslint, 04-19-2009, 09:41 AM
Check , netstat -pant | grep :80 It will show you which service listening also you can kill httpd as follows pkill -9 httpd

Posted by Gladson morris, 04-19-2009, 11:08 AM
fuser -k /usr/sbin/httpd run this command 3 or 4 times pearlin.info The Unix/Linux Knowledgebase

Posted by webdesign jr, 04-19-2009, 01:16 PM
Thanks for the responses, hope it will help. As for the errors_log, there is no usefull info related to the failure.

Posted by Servosupport, 04-19-2009, 03:53 PM
Run to Command netstat -pan netstat -lnp | grep ':80' You will come to know what is exactly using the port 80 which will help you solve your case

Posted by webdesign jr, 04-19-2009, 04:43 PM
I run r similar command - it had shown a lot of workers being, but the server was not responding ... I was sleepy that time but now I think that I noticed there was a "D" with many of the worker threads .. if it was really the case there was no way to kill them, since D means uninteruptible sleep state still have very little clue why this happened, must have something to do with logrotate, I have changed init.d/restart to init.d/reload in the postrotate script and just hope it will help



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
MySQL failover (Views: 636)
Linux C compilers (Views: 628)


Language:

Client Login

Email

Password

Remember Me

Search