重启 apache2 出现如下报错:
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 will be ok
如果某个端口被占用了,ps -aux | grep 3306 无法找到,可以通过
netstat -apn | grep 3306
查找比较隐蔽的端口,再通过获取进程 id
netstat -nlp | grep :3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 37599/
然后再杀死进程
kill -9 37599
查看进程树
pstree -p | wc -l