解决apache2无法重启问题

来源:互联网 发布:谷嫂淘宝同款排除王下载 编辑:程序博客网 时间:2024/06/04 19:03

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.

只要kill them:

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

everything is ok

如果 某个端口被占用了,ps -aux|grep 7004无法找到

可以通过:

netstat -apn | grep 7004  

查找比较隐蔽的端口,再通过获取进程id

netstat -nlp | grep :7004

[root@localhost src]#  netstat -nlp | grep :7004
tcp        0      0 0.0.0.0:7004                0.0.0.0:*                   LISTEN      27596/   

在杀死进程

kill -9 27596

0 0