help me resolve this error in apache
/etc/init.d/apache2 restart
error:
There are processes named \'apache2\' running which do not match your pid file wh
Before killing the process, maybe, you would like to check if the pid file path set in
/etc/apache2/apache2.conf
equals the one stated in APACHE_PID_FILE environment variable exported in the :
/etc/apache2/envvars
file.
Saving a process snapshot before proceeding to kill, would be helpful :
# top -b -n1 > /tmp/process.log
Then get the pid of apache2 with :
pidof apache2
It output the related processes id(s) e.g 4920 4919. Then kill them with :
sudo kill -9 pid
replacing pid with the process id(s) you got from the previous output.
Finally restart Apache 2 server :
sudo /etc/init.d/apache2 restart
Next time would be helpful letting others know basic things about your OS distro etc.
Hope it helps someone.
Kill them.
kill -9 $(ps -e | grep apache2 | awk '{print $1}')
none of these answers worked.. this did
kill -9 $(pidof apache2)
I had a similar problem and I solved this code.
pidof /usr/sbin/apache2
service apache2 restart
It's work.