Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There are processes named 'apache2' running

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 which are left untouched in the name of safety, Please review the situation by hand.

thanks

like image 893
user3393252 Avatar asked Mar 18 '14 21:03

user3393252


2 Answers

Kill them.

kill -9 $(ps -e | grep apache2 | awk '{print $1}')

like image 138
Tyler Henthorn Avatar answered Nov 15 '22 23:11

Tyler Henthorn


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.

like image 29
skechav Avatar answered Nov 15 '22 22:11

skechav