这个问题是安装部署Ganglia时遇到的,httpd版本2.2.15,CentOS版本是6.4。
安装方式:
<span style="color: rgb(221, 221, 221); font-family: monospace; line-height: 22px; background-color: rgb(51, 51, 51);">yum install httpd</span>
安装完成后,启动一切显示正常,但查看httpd状态时:
service httpd status
httpd dead but subsys locked
尝试删除锁:
sudo rm -f /var/lock/subsys/httpd
没有起作用,这时重新启动httpd,报错:
service httpd restart Stopping httpd: [FAILED] Starting httpd: (98)Address already in use: make_sock: could not bind to address 10.10.26.11:80 no listening sockets available, shutting down Unable to open logs [FAILED]于是,网上各种Google找方法,都没解决。
然后检查httpd.conf发现 PidFile变量默认被设置为run/httpd.pid,把它变成指向/var/run:
PidFile /var/run/httpd.pid
同时在
/etc/sysconfig/httpd修改:
PIDFILE=/var/run/httpd.pid
kill掉httpd 进程(或是通过端口查找再kill掉):
killall -9 httpd
删除锁:
sudo rm -f /var/lock/subsys/httpd
重新启动httpd:
sudo service httpd restart
这时问题解决:
service httpd status
httpd (pid 14331) is running...
参考:
https://awaseroot.wordpress.com/2012/06/11/subsys-lock-problem-with-centos-6-2-and-apache/#more-330
安装Ganglia参考:
1.http://blog.csdn.net/wsgzg1991/article/details/9496907
2.http://www.cnblogs.com/Richardzhu/p/3481996.html
3.http://www.tuicool.com/articles/Qjuqym