如何解决刚才默默无闻的Apache httpd?

我有一个Apache的httpd服务器在一夜之间以一种奇怪的方式“死”。 我看过所有相关的日志,找不到任何不寻常的东西。

幸好在我们的开发环境中发生了这种情况,但是我非常担心,因为我们的开发环境与我们的生产环境几乎完全相同。

谁能告诉我在这里会发生什么?

症状和故障排除步骤

  • Apache httpd完全没有响应
  • 平均0.0负载平均
  • 没有日志exception
  • ps aux | grep httpd ps aux | grep httpd显示正常
  • iptables -L显示端口80打开
  • SELinux启用并正确configuration:没有AVClogging
  • 无论系统组件如何变化,无论configuration如何微不足道
  • Apache httpd在服务器时间17:11:25 重新加载 ,以清除APC(php)caching
    • 17:20之后,成功的请求是在我重新加载之后做的
    • 重新加载后没有什么了不起
  • 第二天早上,httpd进程没有响应
  • Telnet到80端口连接成功
    • 手动GET,POST,OPTIONS和HEAD请求没有收到任何回应; 没有logging

日志

访问日志

 172.22.44.41 - - [03/Mar/2011:17:20:18 -0600] "GET /admin.php?type=notifications HTTP/1.0" 200 44326 "http://umc.dev.example.com/admin.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13" 172.22.44.41 - - [04/Mar/2011:14:45:16 -0600] "GET / HTTP/1.0" 200 62921 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13" 

error_log中

 [Thu Mar 03 17:11:25 2011] [notice] SIGHUP received. Attempting to restart [Thu Mar 03 17:11:25 2011] [notice] Digest: generating secret for digest authentication ... [Thu Mar 03 17:11:25 2011] [notice] Digest: done [Thu Mar 03 17:11:25 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations [Fri Mar 04 14:45:05 2011] [notice] caught SIGTERM, shutting down [Fri Mar 04 14:45:05 2011] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0 [Fri Mar 04 14:45:05 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Fri Mar 04 14:45:05 2011] [notice] Digest: generating secret for digest authentication ... [Fri Mar 04 14:45:05 2011] [notice] Digest: done [Fri Mar 04 14:45:05 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations 

ps aux | grep httpd

 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 8477 0.0 1.9 408748 9876 ? Ss Feb24 0:03 /usr/sbin/httpd apache 19933 0.4 14.6 436436 74692 ? S Mar03 0:01 /usr/sbin/httpd apache 19936 0.4 8.4 419708 43148 ? S Mar03 0:01 /usr/sbin/httpd 

在/ var / log / messages中

 Feb 27 04:02:01 webdev1 syslogd 1.4.1: restart. Mar 4 14:43:35 webdev1 yum: Installed: strace-4.5.18-5.el5_5.5.x86_64 

版本

操作系统和内核

  • CentOS版本5.5(最终版)
  • Linux webdev1.int.example.com 2.6.18-194.32.1.el5#1 SMP Wed Jan 5 17:52:25 EST 2011 x86_64 x86_64 x86_64 GNU / Linux

Apache httpd

 Server version: Apache/2.2.3 Server built: Aug 30 2010 12:28:40 Server's Module Magic Number: 20051115:3 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compiled using: APR 1.2.7, APR-Util 1.2.7 Architecture: 64-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" 

PHP

  • php53u-5.3.5-3.ius.el5

使用的存储库

所有软件包的CentOS基础和更新,以下例外:来自IUS社区存储库的php53u。

除了磁盘完全发生,没有太多的去那里。 如果它不再发生,那么它将落在奇怪的类别。 你是否有dmesg输出来查看操作系统是否有问题(例如oom杀手)。

如果它再次发生,那么你将必须使用strace后面的叉子,看看究竟是什么阻止进程。