[英]Apache not serving after server restart
我剛剛使用重新啟動在數字海洋上重新啟動了我的服務器,現在 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'
您可以嘗試多種方法來解決問題:
您可以通過 SSH 連接到您的服務器並檢查配置語法錯誤:
#httpd -t
#httpd -S
如果 httpd.conf 配置正確,您應該會看到“Syntax OK”消息。
您可以檢查 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 配置。
希望您可以在那里嘗試一些想法。
干杯
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.