Apache httpd重启失败

时间:2012-08-09 07:38:47

标签: apache

我正在通过此命令“service httpd restart”重新启动我的apache服务器并收到以下消息:

  

停止httpd:[FAILED]   启动httpd:[确定]

在问题发生之前,我所做的只是用新的数据库文件替换旧的数据库文件。此数据库文件将由另一个php文件使用。当我做替换时,我没有停止httpd。

无法重启apache服务器后,我浏览网页找到解决方案,并尝试了以下方法。

1)试试这个“netstat -lnp | grep httpd”和“lsof -i:80”来查找是否有任何进程绑定端口80.结果是没有进程。

2)通过此“rm -f / var / lock / subsys / httpd”删除锁定的子系统并再次重新启动httpd,但结果与上述消息相同:

Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]

3)即使重新启动服务器,它似乎也不起作用

如何解决这个问题?

error_log显示以下消息:

[Thu Aug 09 15:10:34 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Aug 09 15:10:34 2012] [info] Init: Seeding PRNG with 256 bytes of entropy [Thu Aug 09 15:10:34 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits) [Thu Aug 09 15:10:34 2012] [info] Init: Generating temporary DH parameters (512/1024 bits) [Thu Aug 09 15:10:34 2012] [info] Init: Initializing (virtual) servers for SSL [Thu Aug 09 15:10:34 2012] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5 [Thu Aug 09 15:10:34 2012] [notice] Digest: generating secret for digest authentication ... [Thu Aug 09 15:10:34 2012] [notice] Digest: done [Thu Aug 09 15:10:34 2012] [debug] util_ldap.c(2052): LDAP merging Shared Cache conf: shm=0x8541df0 rmm=0x8541e20 for VHOST: localhost.localdomain [Thu Aug 09 15:10:34 2012] [info] APR LDAP: Built with OpenLDAP LDAP SDK [Thu Aug 09 15:10:34 2012] [info] LDAP: SSL support available [Thu Aug 09 15:27:26 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Aug 09 15:27:26 2012] [info] Init: Seeding PRNG with 256 bytes of entropy [Thu Aug 09 15:27:26 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits) [Thu Aug 09 15:27:26 2012] [info] Init: Generating temporary DH parameters (512/1024 bits) [Thu Aug 09 15:27:26 2012] [info] Init: Initializing (virtual) servers for SSL [Thu Aug 09 15:27:26 2012] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5 [Thu Aug 09 15:27:26 2012] [notice] Digest: generating secret for digest authentication ... [Thu Aug 09 15:27:26 2012] [notice] Digest: done [Thu Aug 09 15:27:26 2012] [debug] util_ldap.c(2052): LDAP merging Shared Cache conf: shm=0x97f4df0 rmm=0x97f4e20 for VHOST: localhost.localdomain [Thu Aug 09 15:27:26 2012] [info] APR LDAP: Built with OpenLDAP LDAP SDK [Thu Aug 09 15:27:26 2012] [info] LDAP: SSL support available ssl_error_log: [Thu Aug 09 15:10:34 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Aug 09 15:10:34 2012] [info] Init: Seeding PRNG with 256 bytes of entropy [Thu Aug 09 15:10:34 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits) [Thu Aug 09 15:10:34 2012] [info] Init: Generating temporary DH parameters (512/1024 bits) [Thu Aug 09 15:10:34 2012] [info] Init: Initializing (virtual) servers for SSL [Thu Aug 09 15:10:34 2012] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5 [Thu Aug 09 15:10:34 2012] [notice] Digest: generating secret for digest authentication ... [Thu Aug 09 15:10:34 2012] [notice] Digest: done [Thu Aug 09 15:10:34 2012] [debug] util_ldap.c(2052): LDAP merging Shared Cache conf: shm=0x8541df0 rmm=0x8541e20 for VHOST: localhost.localdomain [Thu Aug 09 15:10:34 2012] [info] APR LDAP: Built with OpenLDAP LDAP SDK [Thu Aug 09 15:10:34 2012] [info] LDAP: SSL support available [Thu Aug 09 15:27:26 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Thu Aug 09 15:27:26 2012] [info] Init: Seeding PRNG with 256 bytes of entropy [Thu Aug 09 15:27:26 2012] [info] Init: Generating temporary RSA private keys (512/1024 bits) [Thu Aug 09 15:27:26 2012] [info] Init: Generating temporary DH parameters (512/1024 bits) [Thu Aug 09 15:27:26 2012] [info] Init: Initializing (virtual) servers for SSL [Thu Aug 09 15:27:26 2012] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5 [Thu Aug 09 15:27:26 2012] [notice] Digest: generating secret for digest authentication ... [Thu Aug 09 15:27:26 2012] [notice] Digest: done [Thu Aug 09 15:27:26 2012] [debug] util_ldap.c(2052): LDAP merging Shared Cache conf: shm=0x97f4df0 rmm=0x97f4e20 for VHOST: localhost.localdomain [Thu Aug 09 15:27:26 2012] [info] APR LDAP: Built with OpenLDAP LDAP SDK [Thu Aug 09 15:27:26 2012] [info] LDAP: SSL support available 谢谢你的帮助!

3 个答案:

答案 0 :(得分:2)

您可以在httpd.conf文件中启用LogLevel Debug并尝试启动该服务。然后,您应该能够在错误日志中获得更多详细信息。顺便说一句,您似乎已启用SSL,因此最有可能它不会是80但是端口443.如果它是SSL的问题..您可以禁用SSL并启用http并检查apache启动。 您也可以将apache配置为与任何LDAP服务器通信以进行身份​​验证。

答案 1 :(得分:0)

面临同样的问题,但

sudo /etc/init.d/apache2 reload

对我来说效果很好

答案 2 :(得分:0)

对我来说,这适用于RH Linux:

首先启用超级用户模式:

sudo su -

现在转到终端中的Apache(httpd)位置:cd /usr/sbin

To start Apache server:               httpd -k start
To stop Apache server:                httpd -k stop
Check if httpd service is running:    pgrep httpd

希望它有所帮助。