我的服务器经常出问题。它似乎每隔几个小时就会出问题,我不知道原因。
今天早上,我的所有网站都出现了 503 错误,我尝试重新启动 Apache,但是
# service apache2 restart
[....] Restarting web server: apache2(98)Address already in use: make_sock: could not bind to address 127.0.0.1:8080
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
failed!
我发现有些进程仍在运行。终止它们有助于重新启动 Apache。
# grep -ri listen /etc/apache2
/etc/apache2/apache2.conf:# supposed to determine listening ports for incoming connections, and which
/etc/apache2/apache2.conf:# Include list of ports to listen on and which to use for name based vhosts
/etc/apache2/ports.conf:Listen 127.0.0.1:8080
/etc/apache2/ports.conf:#Listen 127.0.0.1:443
/etc/apache2/ports.conf:# Listen 443
/etc/apache2/ports.conf:# Listen 443
# killall -9 apache2
# service apache2 restart
[ ok ] Restarting web server: apache2.
我仍然不知道如何防止它失败,这里有一些我完全不明白的日志。请帮忙:)
从失败那一刻起:
[Sun May 31 06:26:00 2015] [notice] FastCGI: process manager initialized (pid 9466)
[Sun May 31 06:26:00 2015] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'.
[Sun May 31 06:26:00 2015] [error] python_init: Python executable found '/usr/bin/python'.
[Sun May 31 06:26:00 2015] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
[Sun May 31 06:26:00 2015] [notice] mod_python: Creating 8 session mutexes based on 1000 max processes and 0 max threads.
[Sun May 31 06:26:00 2015] [notice] mod_python: using mutex_directory /tmp
[Sun May 31 06:26:01 2015] [notice] Apache/2.2.22 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 Phusion_Passenger/5.0.8 PHP/5.5.25-1~dotdeb+7.1 mod_python/3.3.1 Python/2.7.3 mod_ssl/2.2.22 OpenSSL/1.0.1e mod_wsgi/3.3 configured -- resuming normal operations
[Sun May 31 06:26:01 2015] [warn] long lost child came home! (pid 17083)
[Sun May 31 06:26:01 2015] [warn] long lost child came home! (pid 17328)
[Sun May 31 06:26:01 2015] [warn] long lost child came home! (pid 17329)
[Sun May 31 06:26:01 2015] [warn] long lost child came home! (pid 17330)
并且这基本上是不断记录的:
[Sun May 31 13:36:03 2015] [warn] Couldn't set uid/gid/priority, closing connection.
[Sun May 31 13:36:03 2015] [warn] (itkmpm: pid=30911 uid=1001, gid=1001) itk_post_perdir_config(): setgid(1005): Operation not permitted
[Sun May 31 13:36:03 2015] [warn] Couldn't set uid/gid/priority, closing connection.
[Sun May 31 13:36:03 2015] [warn] (itkmpm: pid=30897 uid=1001, gid=1001) itk_post_perdir_config(): setgid(1005): Operation not permitted
[Sun May 31 13:36:03 2015] [warn] Couldn't set uid/gid/priority, closing connection.
[Sun May 31 13:36:04 2015] [warn] (itkmpm: pid=30930 uid=1001, gid=1001) itk_post_perdir_config(): setgid(33): Operation not permitted
[Sun May 31 13:36:04 2015] [warn] Couldn't set uid/gid/priority, closing connection.
[Sun May 31 13:36:06 2015] [warn] (itkmpm: pid=30938 uid=1001, gid=1001) itk_post_perdir_config(): setgid(33): Operation not permitted