apache 超时?

apache 超时?

我有一个安装有 apache2 的专用服务器。最近,当网站没有被使用时,apache 就开始死机了。

例如,昨天早上 8 点,我在网站上进行一些编程,一切正常。今天上午 10 点,当我尝试登录时,它显示以下消息"server something.com was to slow to load"

现在,一旦我使用服务 apache2 重新启动,它就可以再次正常工作!我对此很陌生,所以有人可以告诉我要寻找什么吗?

我还尝试检查安装的 apache2 版本,但收到以下消息:

    [Thu May 05 12:14:26.037129 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Thu May 05 12:14:26.037154 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Thu May 05 12:14:26.037162 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Thu May 05 12:14:26.037179 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Thu May 05 12:14:26.037186 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu May 05 12:14:26.043258 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Thu May 05 12:14:26.043438 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu May 05 12:14:26.043540 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Thu May 05 12:14:26.043546 2016] [core:warn] [pid 19057] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

错误日志:

    [Thu May 05 12:27:24.550119 2016] [:error] [pid 19189] [client 5.154.190.132:47417] PHP  12. WP_Http_Streams->request() /var/www/somesite.com/public_html/wp-includes/class-http.php:433
[Thu May 05 12:27:24.550222 2016] [:error] [pid 19189] [client 5.154.190.132:47417] PHP  13. stream_socket_client() /var/www/somesite.com/public_html/wp-includes/class-wp-http-streams.php:150
[Thu May 05 12:28:01.156910 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP Warning:  stream_socket_client(): unable to connect to tcp://www.slscxhz66.com:80 (Connection timed out) in /var/www/somesite.com/public_html/wp-includes/class-wp-http-streams.php on line 150
[Thu May 05 12:28:01.157231 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP Stack trace:
[Thu May 05 12:28:01.157549 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   1. {main}() /var/www/somesite.com/public_html/xmlrpc.php:0
[Thu May 05 12:28:01.157871 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   2. wp_xmlrpc_server->serve_request() /var/www/somesite.com/public_html/xmlrpc.php:84
[Thu May 05 12:28:01.158041 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   3. IXR_Server->IXR_Server() /var/www/somesite.com/public_html/wp-includes/class-wp-xmlrpc-server.php:197
[Thu May 05 12:28:01.158209 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   4. IXR_Server->__construct() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:440
[Thu May 05 12:28:01.158586 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   5. IXR_Server->serve() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:432
[Thu May 05 12:28:01.158964 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   6. IXR_Server->call() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:470
[Thu May 05 12:28:01.159293 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   7. wp_xmlrpc_server->pingback_ping() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:520
[Thu May 05 12:28:01.159487 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   8. wp_safe_remote_get() /var/www/somesite.com/public_html/wp-includes/class-wp-xmlrpc-server.php:6306
[Thu May 05 12:28:01.159746 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP   9. WP_Http->get() /var/www/somesite.com/public_html/wp-includes/http.php:70
[Thu May 05 12:28:01.159921 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP  10. WP_Http->request() /var/www/somesite.com/public_html/wp-includes/class-http.php:496
[Thu May 05 12:28:01.160012 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP  11. WP_Http->_dispatch_request() /var/www/somesite.com/public_html/wp-includes/class-http.php:342
[Thu May 05 12:28:01.160064 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP  12. WP_Http_Streams->request() /var/www/somesite.com/public_html/wp-includes/class-http.php:433
[Thu May 05 12:28:01.160112 2016] [:error] [pid 19196] [client 5.154.190.132:52254] PHP  13. stream_socket_client() /var/www/somesite.com/public_html/wp-includes/class-wp-http-streams.php:150
[Thu May 05 12:28:12.016210 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP Warning:  stream_socket_client(): unable to connect to tcp://www.slscxhz66.com:80 (Connection timed out) in /var/www/somesite.com/public_html/wp-includes/class-wp-http-streams.php on line 150
[Thu May 05 12:28:12.016521 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP Stack trace:
[Thu May 05 12:28:12.016791 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   1. {main}() /var/www/somesite.com/public_html/xmlrpc.php:0
[Thu May 05 12:28:12.017062 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   2. wp_xmlrpc_server->serve_request() /var/www/somesite.com/public_html/xmlrpc.php:84
[Thu May 05 12:28:12.017203 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   3. IXR_Server->IXR_Server() /var/www/somesite.com/public_html/wp-includes/class-wp-xmlrpc-server.php:197
[Thu May 05 12:28:12.017284 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   4. IXR_Server->__construct() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:440
[Thu May 05 12:28:12.017640 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   5. IXR_Server->serve() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:432
[Thu May 05 12:28:12.017734 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   6. IXR_Server->call() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:470
[Thu May 05 12:28:12.017791 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   7. wp_xmlrpc_server->pingback_ping() /var/www/somesite.com/public_html/wp-includes/class-IXR.php:520
[Thu May 05 12:28:12.017845 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   8. wp_safe_remote_get() /var/www/somesite.com/public_html/wp-includes/class-wp-xmlrpc-server.php:6306
[Thu May 05 12:28:12.017899 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP   9. WP_Http->get() /var/www/somesite.com/public_html/wp-includes/http.php:70
[Thu May 05 12:28:12.017954 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP  10. WP_Http->request() /var/www/somesite.com/public_html/wp-includes/class-http.php:496
[Thu May 05 12:28:12.018007 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP  11. WP_Http->_dispatch_request() /var/www/somesite.com/public_html/wp-includes/class-http.php:342
[Thu May 05 12:28:12.018060 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP  12. WP_Http_Streams->request() /var/www/somesite.com/public_html/wp-includes/class-http.php:433
[Thu May 05 12:28:12.018143 2016] [:error] [pid 19188] [client 5.154.190.132:41993] PHP  13. stream_socket_client() /var/www/somesite.com/public_html/wp-includes/class-wp-http-streams.php:150

答案1

你的 ubuntu 版本是什么?

如果是 14.04-16.04 那么检查:

sudo gedit /etc/apache2/sites-available/000-default.conf 

如果只显示 =/var/www 则将其更改为 =/var/www/html

并重启 apache

sudo service apache2 restart

相关内容