Apache server still running but user can not connect website, after "sudo apachectl restart" user can connect website, what'r wrong? [on hold]
- by Tinyfool
My website is http://ourcoders.com/, recently I found sometime user report can not connect to my website, but I ssh to server, I found Apache still running, like this:
root@AY1401261057077842eaZ:~# ps aux|grep apache
root 873 0.0 1.3 290496 13528 ? Ss Aug18 0:28 /usr/sbin/apache2 -k start
www-data 3490 0.0 1.8 299004 18764 ? S Aug21 0:01 /usr/sbin/apache2 -k start
www-data 3612 0.0 1.5 296008 15540 ? S Aug21 0:03 /usr/sbin/apache2 -k start
www-data 3860 0.0 1.5 296636 16268 ? S Aug21 0:00 /usr/sbin/apache2 -k start
www-data 3913 0.0 1.2 295468 13084 ? S Aug21 0:00 /usr/sbin/apache2 -k start
www-data 3931 0.0 1.7 298488 18228 ? S 16:02 0:01 /usr/sbin/apache2 -k start
www-data 3938 0.0 1.9 299128 19724 ? S 16:02 0:02 /usr/sbin/apache2 -k start
www-data 4465 0.0 1.6 296688 16404 ? S Aug21 0:00 /usr/sbin/apache2 -k start
www-data 5075 0.0 1.2 295468 13044 ? S 16:16 0:00 /usr/sbin/apache2 -k start
www-data 5153 0.0 1.5 295880 15612 ? S 16:17 0:00 /usr/sbin/apache2 -k start
www-data 5770 0.0 1.5 296608 16016 ? S 16:30 0:00 /usr/sbin/apache2 -k start
www-data 5773 0.0 1.6 296948 16640 ? S 16:30 0:00 /usr/sbin/apache2 -k start
www-data 5816 0.0 1.6 297216 16976 ? S 16:31 0:01 /usr/sbin/apache2 -k start
www-data 5918 0.0 1.7 298228 17820 ? S 16:33 0:01 /usr/sbin/apache2 -k start
www-data 6023 0.0 1.9 299864 19840 ? S 16:35 0:13 /usr/sbin/apache2 -k start
www-data 6073 0.0 1.7 298480 18120 ? S 16:36 0:02 /usr/sbin/apache2 -k start
www-data 6088 0.0 2.0 300488 21008 ? S 16:36 0:12 /usr/sbin/apache2 -k start
www-data 6114 0.0 1.7 298548 18268 ? S 16:37 0:12 /usr/sbin/apache2 -k start
www-data 6134 0.0 1.6 296688 16532 ? S 16:37 0:04 /usr/sbin/apache2 -k start
www-data 6193 0.0 1.7 297908 17420 ? S 16:38 0:08 /usr/sbin/apache2 -k start
www-data 6821 0.0 1.8 299556 19072 ? S 16:43 0:11 /usr/sbin/apache2 -k start
www-data 7058 0.0 1.7 298676 18204 ? S 16:48 0:10 /usr/sbin/apache2 -k start
www-data 7065 0.0 1.8 299028 18868 ? S 16:48 0:11 /usr/sbin/apache2 -k start
www-data 7084 0.0 1.8 299508 19020 ? S 16:48 0:11 /usr/sbin/apache2 -k start
www-data 7221 0.0 1.8 299160 18768 ? S 16:51 0:09 /usr/sbin/apache2 -k start
www-data 11453 0.0 1.7 298484 18256 ? S 09:39 0:02 /usr/sbin/apache2 -k start
root 26324 0.0 0.0 8084 920 pts/0 S+ 22:52 0:00 grep --color=auto apache
root 28517 0.0 0.0 4404 612 ? S Aug21 0:00 /bin/sh -c /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28518 0.0 0.0 4404 616 ? S Aug21 0:00 /bin/sh -c /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28519 0.0 0.0 4404 612 ? S Aug21 0:00 /bin/sh -c /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28520 0.0 0.0 4404 616 ? S Aug21 0:00 /bin/sh -c /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28521 0.0 0.0 4312 552 ? S Aug21 0:00 /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28522 0.0 0.0 4308 548 ? S Aug21 0:07 /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28523 0.0 0.0 4176 352 ? S Aug21 0:00 /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
root 28524 0.0 0.0 4180 356 ? S Aug21 0:00 /usr/sbin/cronolog /var/log/apache2/cocoa/%Y/%m/access-%Y-%m-%d.log
Today's only error log is blow.
[Sat Aug 23 22:52:47 2014] [notice] SIGHUP received. Attempting to restart
[Sat Aug 23 22:52:47 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.13 with Suhosin-Patch configured -- resuming normal operations
traffic information:
cat access-2014-08-23.log | cut -d " " -f4 |cut -d":" -f2 |sort|uniq -c |sort -nr
5692 14
5291 15
5083 16
4723 23
4463 12
4057 17
4011 11
3926 13
3852 10
3187 05
3176 09
3055 06
2790 07
2672 00
2608 02
2591 01
2577 04
2514 03
2497 08
707 22
88 18
After I use "sudo apachectl restart", user can connect my website.
So I want to know? What is the problem?
And if "sudo apachectl restart" is needed, can I automate run this command?
Today this kind struts appear again, and I run netstat -a -n
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 115.28.146.116:80 125.39.208.120:50708 SYN_RECV
tcp 0 0 115.28.146.116:80 125.39.208.158:50278 SYN_RECV
tcp 0 0 115.28.146.116:80 220.173.142.152:23320 SYN_RECV
tcp 0 0 115.28.146.116:80 60.173.247.132:52851 SYN_RECV
tcp 0 0 115.28.146.116:80 125.39.208.158:39397 SYN_RECV
tcp 0 0 115.28.146.116:80 125.39.208.158:56894 SYN_RECV
tcp 0 0 115.28.146.116:80 183.129.174.2:21291 SYN_RECV
tcp 0 0 115.28.146.116:80 125.39.208.120:44499 SYN_RECV
tcp 0 0 115.28.146.116:80 125.39.208.120:34017 SYN_RECV
tcp 0 0 115.28.146.116:80 124.65.50.210:3774 SYN_RECV
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:15770 0.0.0.0:* LISTEN
tcp 1 0 115.28.146.116:80 14.127.65.219:61633 CLOSE_WAIT
tcp 305 0 115.28.146.116:80 125.39.208.120:37593 ESTABLISHED
tcp 0 0 10.144.142.201:52866 10.146.6.61:3306 TIME_WAIT
tcp 0 0 10.144.142.201:52873 10.146.6.61:3306 TIME_WAIT
tcp 0 0 10.144.142.201:52868 10.146.6.61:3306 TIME_WAIT
tcp 343 0 115.28.146.116:80 182.118.20.215:50709 ESTABLISHED
tcp 0 0 115.28.146.116:54784 173.194.127.243:80 ESTABLISHED
tcp 1 0 115.28.146.116:80 116.192.2.185:41253 CLOSE_WAIT
tcp 0 0 10.144.142.201:52876 10.146.6.61:3306 ESTABLISHED
tcp 559 0 115.28.146.116:80 218.241.144.114:54501 ESTABLISHED
tcp 376 0 115.28.146.116:80 116.213.196.119:50604 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59339 CLOSE_WAIT
tcp 214 0 115.28.146.116:80 142.4.215.40:34443 ESTABLISHED
tcp 0 0 115.28.146.116:48635 115.28.146.116:80 ESTABLISHED
tcp 187 0 115.28.146.116:80 115.28.146.116:48635 ESTABLISHED
tcp 0 0 10.144.142.201:52853 10.146.6.61:3306 TIME_WAIT
tcp 594 0 115.28.146.116:80 183.129.174.2:7090 CLOSE_WAIT
tcp 0 0 10.144.142.201:52874 10.146.6.61:3306 TIME_WAIT
tcp 0 0 115.28.146.116:80 182.118.20.166:44081 TIME_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59028 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 14.127.65.219:61665 CLOSE_WAIT
tcp 0 0 10.144.142.201:52860 10.146.6.61:3306 TIME_WAIT
tcp 0 0 10.144.142.201:46983 10.146.6.61:3306 ESTABLISHED
tcp 0 2290 115.28.146.116:80 14.154.179.243:41049 FIN_WAIT1
tcp 0 0 10.144.142.201:42900 10.146.6.61:3306 ESTABLISHED
tcp 571 0 115.28.146.116:80 220.173.142.152:23295 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59337 CLOSE_WAIT
tcp 438 0 115.28.146.116:80 42.120.74.202:31567 CLOSE_WAIT
tcp 0 0 115.28.146.116:80 113.36.238.28:59498 ESTABLISHED
tcp 259 0 115.28.146.116:80 66.249.65.56:36739 ESTABLISHED
tcp 0 0 115.28.146.116:80 113.36.238.28:59341 ESTABLISHED
tcp 0 0 115.28.146.116:80 142.4.215.40:34267 FIN_WAIT2
tcp 799 0 115.28.146.116:80 180.173.88.1:52779 ESTABLISHED
tcp 0 0 115.28.146.116:80 117.136.25.132:25207 FIN_WAIT2
tcp 0 0 115.28.146.116:80 220.181.108.186:42540 TIME_WAIT
tcp 0 0 10.144.142.201:59902 10.242.174.13:80 TIME_WAIT
tcp 0 1820 115.28.146.116:80 218.22.140.90:39266 LAST_ACK
tcp 0 0 115.28.146.116:80 66.249.65.64:56977 TIME_WAIT
tcp 669 0 115.28.146.116:80 83.251.90.61:49664 ESTABLISHED
tcp 0 0 10.144.142.201:52872 10.146.6.61:3306 TIME_WAIT
tcp 233 0 115.28.146.116:80 54.202.88.0:43398 CLOSE_WAIT
tcp 479 0 115.28.146.116:80 65.49.44.149:25739 ESTABLISHED
tcp 378 0 115.28.146.116:80 148.251.124.173:39313 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 14.127.65.219:61697 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 49.4.158.2:52986 CLOSE_WAIT
tcp 769 0 115.28.146.116:80 14.127.65.219:61537 ESTABLISHED
tcp 0 0 10.144.142.201:52859 10.146.6.61:3306 TIME_WAIT
tcp 0 0 10.144.142.201:55734 10.164.2.163:9200 TIME_WAIT
tcp 563 0 115.28.146.116:80 202.55.20.10:22577 CLOSE_WAIT
tcp 194 0 115.28.146.116:80 37.58.100.165:50908 CLOSE_WAIT
tcp 791 0 115.28.146.116:80 116.192.2.185:45628 ESTABLISHED
tcp 709 0 115.28.146.116:80 113.116.61.178:65209 ESTABLISHED
tcp 706 0 115.28.146.116:80 183.227.44.237:54519 ESTABLISHED
tcp 301 0 115.28.146.116:80 118.198.243.127:31180 ESTABLISHED
tcp 0 0 10.144.142.201:55721 10.164.2.163:9200 TIME_WAIT
tcp 0 0 10.144.142.201:55726 10.164.2.163:9200 TIME_WAIT
tcp 0 0 10.144.142.201:55723 10.164.2.163:9200 TIME_WAIT
tcp 681 0 115.28.146.116:80 83.251.90.61:49662 ESTABLISHED
tcp 0 0 115.28.146.116:80 83.251.90.61:65274 TIME_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59022 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 180.173.88.1:52781 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59037 CLOSE_WAIT
tcp 0 0 10.144.142.201:55728 10.164.2.163:9200 TIME_WAIT
tcp 231 0 115.28.146.116:37596 110.75.102.62:80 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 14.127.65.219:61569 CLOSE_WAIT
tcp 0 0 10.144.142.201:51310 10.146.6.61:3306 ESTABLISHED
tcp 299 0 115.28.146.116:80 123.125.71.16:36281 ESTABLISHED
tcp 0 0 115.28.146.116:48620 115.28.146.116:80 ESTABLISHED
tcp 1 0 115.28.146.116:80 183.227.44.237:54520 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59026 CLOSE_WAIT
tcp 479 0 115.28.146.116:80 65.49.44.149:5490 ESTABLISHED
tcp 665 0 115.28.146.116:80 83.251.90.61:49663 ESTABLISHED
tcp 0 0 115.28.146.116:53744 173.194.127.147:80 ESTABLISHED
tcp 1 0 115.28.146.116:80 113.36.238.28:59023 CLOSE_WAIT
tcp 0 0 115.28.146.116:22 116.192.2.185:34205 ESTABLISHED
tcp 333 0 115.28.146.116:80 149.174.113.111:54338 CLOSE_WAIT
tcp 0 0 10.144.142.201:52861 10.146.6.61:3306 TIME_WAIT
tcp 0 0 10.144.142.201:52863 10.146.6.61:3306 TIME_WAIT
tcp 1 0 115.28.146.116:80 116.192.2.185:43272 CLOSE_WAIT
tcp 767 0 115.28.146.116:80 49.4.158.2:52947 CLOSE_WAIT
tcp 668 0 115.28.146.116:80 83.251.90.61:49665 ESTABLISHED
tcp 642 0 115.28.146.116:80 222.78.185.50:55788 ESTABLISHED
tcp 710 0 115.28.146.116:80 113.116.61.178:65264 ESTABLISHED
tcp 284 0 115.28.146.116:80 157.55.39.243:65185 ESTABLISHED
tcp 450 0 115.28.146.116:80 65.49.44.149:55496 ESTABLISHED
tcp 1 0 115.28.146.116:80 116.192.2.185:36629 CLOSE_WAIT
tcp 233 0 115.28.146.116:80 54.202.88.0:42424 CLOSE_WAIT
tcp 187 0 115.28.146.116:80 115.28.146.116:48620 ESTABLISHED
tcp 1 0 115.28.146.116:80 14.127.65.219:61601 CLOSE_WAIT
tcp 776 0 115.28.146.116:80 202.118.253.102:64883 CLOSE_WAIT
tcp 841 0 115.28.146.116:80 37.228.105.28:49472 ESTABLISHED
tcp 787 0 115.28.146.116:80 112.65.226.198:52192 ESTABLISHED
tcp 0 0 10.144.142.201:55717 10.164.2.163:9200 TIME_WAIT
tcp 233 0 115.28.146.116:80 54.202.88.0:42855 CLOSE_WAIT
tcp 379 0 115.28.146.116:80 101.226.166.219:2322 ESTABLISHED
tcp 0 0 115.28.146.116:80 183.60.212.152:43063 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 180.173.88.1:52780 CLOSE_WAIT
tcp 784 0 115.28.146.116:80 101.95.29.26:63094 ESTABLISHED
tcp 463 0 115.28.146.116:80 65.49.44.149:53876 ESTABLISHED
tcp 1 0 115.28.146.116:80 116.192.2.185:37946 CLOSE_WAIT
tcp 479 0 115.28.146.116:80 65.49.44.149:41157 ESTABLISHED
tcp 1 0 115.28.146.116:80 113.36.238.28:59036 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 49.4.158.2:52984 CLOSE_WAIT
tcp 1 0 115.28.146.116:80 116.192.2.185:38100 CLOSE_WAIT
tcp 0 0 10.144.142.201:52865 10.146.6.61:3306 TIME_WAIT
tcp 1 0 115.28.146.116:80 113.36.238.28:59027 CLOSE_WAIT
tcp 0 0 115.28.146.116:36508 173.194.127.81:80 ESTABLISHED
tcp 210 0 115.28.146.116:80 188.143.232.123:47775 ESTABLISHED
tcp 1 0 115.28.146.116:80 113.36.238.28:59025 CLOSE_WAIT
tcp 0 0 10.144.142.201:52857 10.146.6.61:3306 TIME_WAIT
tcp 654 0 115.28.146.116:80 49.4.158.2:52985 ESTABLISHED
tcp 0 0 115.28.146.116:58627 110.75.102.62:80 ESTABLISHED
tcp 782 0 115.28.146.116:80 180.153.219.13:40293 ESTABLISHED
tcp 792 0 115.28.146.116:80 116.192.2.185:48187 CLOSE_WAIT
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 115.28.146.116:123 0.0.0.0:*
udp 0 0 10.144.142.201:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
udp6 0 0 :::123 :::*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 8447 /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] SEQPACKET LISTENING 6678 /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 6482 @/com/ubuntu/upstart
unix 2 [ ACC ] STREAM LISTENING 7543 /var/run/dbus/system_bus_socket
unix 7 [ ] DGRAM 7551 /dev/log
unix 2 [ ACC ] STREAM LISTENING 7650 /var/run/nscd/socket
unix 2 [ ] DGRAM 7156424
unix 3 [ ] STREAM CONNECTED 7156137 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7156136
unix 2 [ ] DGRAM 7156135
unix 2 [ ] DGRAM 7155834
unix 2 [ ] DGRAM 9734
unix 3 [ ] STREAM CONNECTED 9151 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 9150
unix 3 [ ] STREAM CONNECTED 9136 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 9135
unix 3 [ ] STREAM CONNECTED 9106 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 9105
unix 2 [ ] DGRAM 9073
unix 3 [ ] STREAM CONNECTED 7575 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7574
unix 3 [ ] STREAM CONNECTED 7565
unix 3 [ ] STREAM CONNECTED 7564
unix 3 [ ] STREAM CONNECTED 7332 @/com/ubuntu/upstart
unix 3 [ ] STREAM CONNECTED 7330
unix 3 [ ] DGRAM 6712
unix 3 [ ] DGRAM 6711
unix 3 [ ] STREAM CONNECTED 6662 @/com/ubuntu/upstart
unix 3 [ ] STREAM CONNECTED 6635