服务器重启后Apache无法提供服务

时间:2015-10-01 13:02:20

标签: apache ubuntu apache2

我刚刚使用reboot重新启动了数字海洋上的服务器,现在apache没有为任何页面提供服务。我可以从我的客户端ping IP。重启前一切正常。以下是我迄今为止所完成的一些测试的一些输出:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1005/sshd       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1774/sendmail: MTA:
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1241/mysqld     
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      1774/sendmail: MTA:
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      1703/memcached  
tcp6       0      0 :::22                   :::*                    LISTEN      1005/sshd       
tcp6       0      0 :::443                  :::*                    LISTEN      2991/apache2    
tcp6       0      0 :::80                   :::*                    LISTEN      2991/apache2    

这是netstat的结果。我不确定,但这是否意味着apache没有监听IPV4(TCP)?:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1005/sshd       
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1774/sendmail: MTA:
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1241/mysqld     
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      1774/sendmail: MTA:
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      1703/memcached  
tcp6       0      0 :::22                   :::*                    LISTEN      1005/sshd       
tcp6       0      0 :::443                  :::*                    LISTEN      2991/apache2    
tcp6       0      0 :::80                   :::*                    LISTEN      2991/apache2    
udp        0      0 127.0.0.1:11211         0.0.0.0:*                           1703/memcached  

error.log似乎没问题:

[Thu Oct 01 09:09:20.131886 2015] [mpm_prefork:notice] [pid 2991]          AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Thu Oct 01 09:09:20.213216 2015] [:notice] [pid 3176] FastCGI: process manager initialized (pid 3176)
[Thu Oct 01 09:09:20.221458 2015] [ssl:warn] [pid 2991] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Thu Oct 01 09:09:21.001486 2015] [mpm_prefork:notice] [pid 2991] AH00163: Apache/2.4.7 (Ubuntu) mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.0.1f configured -- resuming normal operations
[Thu Oct 01 09:09:21.002462 2015] [core:notice] [pid 2991] AH00094: Command line: '/usr/sbin/apache2'

1 个答案:

答案 0 :(得分:0)

您可以尝试各种方法来解决问题:

您可以通过SSH连接到服务器并检查配置语法错误:

#httpd -t
#httpd -S

你应该看到"语法OK"如果httpd.conf配置正确,则显示消息。

您可以查看Apache错误日志文件,该文件将指出确切的问题位置:

tail -f /var/log/httpd-error.log
egrep -i 'warn|error' /var/log/httpd-error.log

另一种选择是检查可能正在使用端口80或443的其他进程。使用netstat命令列出打开的端口及其所有者:

 # netstat -tulpn
 # netstat -tulpn | grep
 # netstat -tulpn | grep ':80'

如果使用端口80/443的其他进程,则需要停止它们或为Apache分配另一个端口。

如果上述内容都没有帮助,您可以检查开放文件FD限制,Apache / PHP / Python / CGI日志文件大小和DNS配置。

希望您可以尝试一些想法。

干杯

相关问题