Reputation: 6525
I just restarted my server on digital ocean using reboot, and now apache is not serving any pages. I can ping the IP from my client. Everything was working fine before the restart. Here are some outputs from some of the tests I've done so far:
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
Here is result of netstat. I'm not sure but does this mean that apache is not listening on 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
The error.log seems OK:
[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'
Upvotes: 2
Views: 18143
Reputation: 1135
There are various things you can try to resolve the problem:
You can SSH into your server and check for a config syntax error:
#httpd -t
#httpd -S
You should see a "Syntax OK" message if the httpd.conf is configured properly.
You could check the Apache Error Log File which will point out the exact problem location:
tail -f /var/log/httpd-error.log
egrep -i 'warn|error' /var/log/httpd-error.log
Another option is to check for other processes that may be using port 80 or 443. Use the netstat command to list open ports and their owners:
# netstat -tulpn
# netstat -tulpn | grep
# netstat -tulpn | grep ':80'
If other process using port 80 / 443, you need to stop them or assign another port to Apache.
If none of the above things are helpful, you can check for open file FD limits, Apache/PHP/Python/CGI log file size and DNS configuration.
Hopefully there are some ideas you can try there.
Cheers
Upvotes: 0