这是我迄今为止所尝试的:
编辑:/ etc / sysconfig / httpd
PIDFILE=/var/run/httpd.pid
编辑:/etc/httpd/conf/httpd.conf
PidFile /var/run/httpd.pid
然后
killall -9 httpd
结果:
httpd: no process killed
然后:
sudo rm -f /var/lock/subsys/httpd sudo service httpd restart
结果:
Stopping httpd: [FAILED] Starting httpd: [ OK ]
然后:
sudo service httpd status
结果:
httpd dead but subsys locked
还是没有运气,我错过了这个问题的解决? 请帮忙
注意:当我启动httpd时,它不会在/ var / run上生成一个httpd.pid
Apache错误日志
[Tue Dec 10 06:27:42 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 06:27:42 2013] [notice] Digest: done [Tue Dec 10 06:31:27 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 06:31:27 2013] [notice] Digest: done [Tue Dec 10 06:45:21 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 06:45:21 2013] [notice] Digest: done [Tue Dec 10 06:52:47 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 06:52:47 2013] [notice] Digest: done [Tue Dec 10 06:55:46 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 06:55:46 2013] [notice] Digest: done [Tue Dec 10 07:06:21 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 07:06:21 2013] [notice] Digest: done [Tue Dec 10 07:13:35 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 07:13:35 2013] [notice] Digest: done [Tue Dec 10 07:20:44 2013] [notice] Digest: generating secret for digest authentication ... [Tue Dec 10 07:20:44 2013] [notice] Digest: done
附加信息
ps auxwww
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.2 19316 1512 ? Ss 06:44 0:00 /sbin/init root 2 0.0 0.0 0 0 ? S 06:44 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S 06:44 0:00 [ksoftirqd/0] root 4 0.0 0.0 0 0 ? S 06:44 0:00 [migration/0] root 5 0.0 0.0 0 0 ? S 06:44 0:00 [watchdog/0] root 6 0.0 0.0 0 0 ? S 06:44 0:00 [events/0] root 7 0.0 0.0 0 0 ? S 06:44 0:00 [cpuset] root 8 0.0 0.0 0 0 ? S 06:44 0:00 [khelper] root 17 0.0 0.0 0 0 ? S 06:44 0:00 [netns] root 18 0.0 0.0 0 0 ? S 06:44 0:00 [async/mgr] root 23 0.0 0.0 0 0 ? S 06:44 0:00 [xenwatch] root 24 0.0 0.0 0 0 ? S 06:44 0:00 [xenbus] root 72 0.0 0.0 0 0 ? S 06:44 0:00 [sync_supers] root 74 0.0 0.0 0 0 ? S 06:44 0:00 [bdi-default] root 75 0.0 0.0 0 0 ? S 06:44 0:00 [kintegrityd/0] root 77 0.0 0.0 0 0 ? S 06:44 0:00 [kblockd/0] root 84 0.0 0.0 0 0 ? S 06:44 0:00 [kseriod] root 193 0.0 0.0 0 0 ? S 06:44 0:00 [khungtaskd] root 194 0.0 0.0 0 0 ? S 06:44 0:00 [kswapd0] root 195 0.0 0.0 0 0 ? SN 06:44 0:00 [ksmd] root 248 0.0 0.0 0 0 ? S 06:44 0:00 [aio/0] root 251 0.0 0.0 0 0 ? S 06:44 0:00 [crypto/0] root 263 0.0 0.0 0 0 ? S 06:44 0:00 [khvcd] root 343 0.0 0.0 0 0 ? S 06:44 0:00 [kstriped] root 533 0.0 0.0 0 0 ? S 06:44 0:00 [jbd2/xvda1-8] root 534 0.0 0.0 0 0 ? S 06:44 0:00 [ext4-dio-unwrit] root 557 0.0 0.0 0 0 ? S 06:44 0:00 [flush-202:1] root 564 0.0 0.0 0 0 ? S 06:44 0:00 [khubd] root 614 0.0 0.1 10772 716 ? S<s 06:44 0:00 /sbin/udevd -d root 834 0.0 0.0 0 0 ? S 06:45 0:00 [kauditd] root 985 0.0 0.0 9220 588 ? Ss 06:45 0:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0 root 1022 0.0 0.2 248984 1272 ? Sl 06:45 0:00 /sbin/rsyslogd -c 4 root 1072 0.0 0.1 64396 1096 ? Ss 06:45 0:00 /usr/sbin/sshd ntp 1079 0.0 0.2 30424 1656 ? Ss 06:45 0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g root 1094 0.0 0.3 86952 2356 ? Ss 06:45 0:00 sendmail: accepting connections smmsp 1102 0.0 0.3 78428 2068 ? Ss 06:45 0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue mongod 1115 0.4 2.2 627080 13872 ? Sl 06:45 0:35 /usr/bin/mongod -f /etc/mongod.conf root 1123 0.0 0.2 117288 1228 ? Ss 06:45 0:00 crond root 1134 0.0 0.0 23724 396 ? Ss 06:45 0:00 /usr/sbin/atd zend 1191 0.0 0.1 23956 1084 ? Ss 06:45 0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-monitor.ini -u 221 -g 498 -s monitor zend 1193 0.0 0.5 350012 3616 ? Ssl 06:45 0:00 /usr/local/zend/bin/MonitorNode /usr/local/zend/etc/monitor_node.ini /usr/local/zend/etc/conf.d -e zend 1266 0.0 0.1 23956 1092 ? Ss 06:45 0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-sc.ini -u 221 -g 498 -s scd zend 1268 0.0 0.5 656968 3316 ? Ssl 06:45 0:00 /usr/local/zend/bin/scd -p /usr/local/zend/etc/scd.ini -e zend 1325 0.0 0.1 23956 1088 ? Ss 06:45 0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-deployment.ini -u 221 -g 498 -s zdd zend 1327 0.1 0.6 203324 3748 ? Ssl 06:45 0:09 /usr/local/zend/bin/zdd /usr/local/zend/etc/zdd.ini -e zend 1374 0.0 0.1 23956 1088 ? Ss 06:45 0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-jq.ini -u 221 -g 498 -s jqd zend 1376 0.0 0.6 137456 4140 ? Ss 06:45 0:01 /usr/local/zend/bin/jqd -f /usr/local/zend/etc/jqd.ini -e root 1420 0.0 0.1 23956 1088 ? Ss 06:45 0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-lighttpd.ini -u zend -g zend -s lighttpd zend 1422 0.0 0.3 26840 1880 ? Ss 06:45 0:00 /usr/local/zend/gui/lighttpd/sbin/lighttpd -m /usr/local/zend/gui/lighttpd/lib -f /usr/local/zend/gui/lighttpd/etc/lighttpd.conf -D root 1446 0.0 0.0 4164 576 tty1 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty1 root 1448 0.0 0.0 4164 576 tty2 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty2 root 1450 0.0 0.0 4164 576 tty3 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty3 root 1452 0.0 0.0 4164 576 tty4 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty4 root 1455 0.0 0.0 4164 572 tty5 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty5 root 1459 0.0 0.1 10768 688 ? S< 06:45 0:00 /sbin/udevd -d root 1460 0.0 0.1 10768 688 ? S< 06:45 0:00 /sbin/udevd -d root 1461 0.0 0.1 4176 624 hvc0 Ss+ 06:45 0:00 /sbin/agetty /dev/hvc0 38400 vt100-nav root 1462 0.0 0.0 4164 572 tty6 Ss+ 06:45 0:00 /sbin/mingetty /dev/tty6 root 1472 0.0 2.2 337484 13888 ? SN 06:45 0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd root 1474 0.0 0.1 9336 1204 ? SN 06:45 0:00 /usr/libexec/gam_server root 1483 0.0 0.6 100236 3908 ? Ss 06:47 0:00 sshd: ec2-user [priv] ec2-user 1486 0.0 0.2 100236 1744 ? S 06:47 0:00 sshd: ec2-user@pts/0 ec2-user 1487 0.0 0.4 109456 3012 pts/0 Ss 06:47 0:00 -bash ec2-user 1963 0.0 0.1 108112 1132 pts/0 R+ 08:58 0:00 ps auxwww
sudo find / etc / httpd /etc/zce.rc -type f -exec grep -i errorlog {} / dev / null \;
/etc/httpd/conf/httpd.conf:# ErrorLog: The location of the error log file. /etc/httpd/conf/httpd.conf:# If you do not specify an ErrorLog directive within a <VirtualHost> /etc/httpd/conf/httpd.conf:ErrorLog logs/error_log /etc/httpd/conf/httpd.conf:# ErrorLog logs/dummy-host.example.com-error_log /etc/httpd/conf/httpd.conf.rpmnew:# ErrorLog: The location of the error log file. /etc/httpd/conf/httpd.conf.rpmnew:# If you do not specify an ErrorLog directive within a <VirtualHost> /etc/httpd/conf/httpd.conf.rpmnew:ErrorLog logs/error_log /etc/httpd/conf/httpd.conf.rpmnew:# ErrorLog logs/dummy-host.example.com-error_log /etc/httpd/conf.d/zendserver_gui.conf: ErrorLog /usr/local/zend/var/log/gui_vhost_error.log /etc/httpd/conf.d/ssl.conf:ErrorLog logs/ssl_error_log
在我的服务器上有相同的错误:
> service httpd status httpd dead but subsys locked
发现,目录/ var / run / httpd是不可读/世界可执行的:
drwx------ 2 root apache 4096 Apr 23 14:15 /var/run/httpd
因此,任何用户(除了root)都不能检查pidfile(它确实存在)! httpd-Process已经运行正常,但服务命令无法读取pidfile …
# chmod a+rx /var/run/httpd
确实解决了这个问题:
> service httpd status httpd (pid 2848) is running...
最近更新到RHEL 6,并有同样的问题。 经过大量的来回之后,我发现/etc/sysconfig/httpd文件和/etc/httpd/conf/httpd.conf文件中的PID文件位置的默认值是不同的。 缺省值是/var/run/httpd/httpd.pid文件中的值是/var/run/httpd.pid 。
我修正了httpd.conf文件中的值,在/var/run下创build了httpd目录,而伪造的消息不见了。
目前,最紧迫的问题是你的configuration文件中有一个致命的错误。 apachectl configtest的输出是非常明确的。
你对此做的事情不太清楚。 正如其他人所指出的那样,包含/etc/zce.rc是Zend的宿醉,对此我知之甚less。 如果你认为你需要这个,你需要找出指定的文件已经去了哪里,然后把它找回来; 您的系统备份将在这里帮助。 如果你不认为你需要它,你可以尝试在/etc/sysconfig/httpd注释第32行,然后看看Apache是否会启动。
编辑 :只是为了确保我们不会错过一些重要的错误输出,因为它在别处,你可以编辑成你的问题的输出
find /etc/httpd /etc/zce.rc -type f -exec grep -i errorlog {} /dev/null \;
编辑2 :啊,他们是相对path。 你可以添加ServerRoot的值吗?
不得不在/ etc / httpd / conf /中更改httpd.config,
从:PidFile运行/ httpd.pid到:PidFile /var/run/httpd.pid
另外,在/ etc / sysconfig /
从:
到:PIDFILE = / var / run / httpd.pid
运行以下命令:
killall -9 httpd
那么,要删除httpd锁:
rm -f / var / lock / subsys / httpd
并重新启动Apache:服务httpd重新启动
我最终将Linux平台从RedHat切换到了CentOS,并从头开始重新开始,一切正常。