我已将日志设置为调试,希望能够找到导致崩溃的原因,但我什么也没找到。这是错误日志。
[Thu Jan 06 10:27:35 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 19999 for (*)
[Thu Jan 06 14:47:04 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Jan 06 14:47:04 2011] [info] Init: Seeding PRNG with 256 bytes of entropy
[Thu Jan 06 14:47:04 2011] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Thu Jan 06 14:47:04 2011] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Thu Jan 06 14:47:04 2011] [info] Init: Initializing (virtual) servers for SSL
[Thu Jan 06 14:47:04 2011] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5
[Thu Jan 06 14:47:04 2011] [notice] Digest: generating secret for digest authentication ...
[Thu Jan 06 14:47:04 2011] [notice] Digest: done
[Thu Jan 06 14:47:04 2011] [debug] util_ldap.c(2021): LDAP merging Shared Cache conf: shm=0xb9dc2480 rmm=0xb9dc24b0 for VHOST: server.fredfinn.com
[Thu Jan 06 14:47:04 2011] [info] APR LDAP: Built with OpenLDAP LDAP SDK
[Thu Jan 06 14:47:04 2011] [info] LDAP: SSL support available
[Thu Jan 06 14:47:05 2011] [info] Init: Seeding PRNG with 256 bytes of entropy
[Thu Jan 06 14:47:05 2011] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Thu Jan 06 14:47:05 2011] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(374): shmcb_init allocated 512000 bytes of shared memory
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(554): entered shmcb_init_memory()
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(576): for 512000 bytes, recommending 4266 indexes
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(619): shmcb_init_memory choices follow
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(621): division_mask = 0x1F
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(623): division_offset = 64
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(625): division_size = 15998
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(627): queue_size = 1604
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(629): index_num = 133
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(631): index_offset = 8
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(633): index_size = 12
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(635): cache_data_offset = 8
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(637): cache_data_size = 14386
[Thu Jan 06 14:47:05 2011] [debug] ssl_scache_shmcb.c(650): leaving shmcb_init_memory()
[Thu Jan 06 14:47:05 2011] [info] Shared memory session cache initialised
[Thu Jan 06 14:47:05 2011] [info] Init: Initializing (virtual) servers for SSL
[Thu Jan 06 14:47:05 2011] [info] Server: Apache/2.2.3, Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8e-fips-rhel5
[Thu Jan 06 14:47:05 2011] [warn] pid file /etc/httpd/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26527 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26527 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26528 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26528 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26529 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26529 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26530 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26530 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26532 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26532 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26533 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26533 for (*)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26534 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26534 for (*)
[Thu Jan 06 14:47:05 2011] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Thu Jan 06 14:47:05 2011] [info] Server built: Aug 30 2010 12:32:08
[Thu Jan 06 14:47:05 2011] [debug] prefork.c(991): AcceptMutex: sysvsem (default: sysvsem)
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1854): proxy: grabbed scoreboard slot 0 in child 26531 for worker proxy:reverse
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1873): proxy: worker proxy:reverse already initialized
[Thu Jan 06 14:47:05 2011] [debug] proxy_util.c(1967): proxy: initialized single connection worker 0 in child 26531 for (*)
日志设置如下:
ErrorLog logs/error_log
LogLevel debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
CustomLog logs/access_log combined
ServerSignature On
答案1
您是否获取了核心转储文件?您可以在其上运行调试器以查看崩溃的位置。这样您就可以识别崩溃是发生在 Apache 核心代码中还是发生在某个模块中。如果是模块,那么您可以查找该模块的错误和更新。
请参阅此处以了解尝试转储核心的设置:
http://httpd.apache.org/docs/2.0/mod/mpm_common.html#coredumpdirectory
答案2
另一种方法是在前台运行 apache,然后另外使用 启动它strace
。
第一次尝试:
httpd -X -f <your config file>
第二次尝试:
strace httpd -X -f <your config file>
这将为您提供大量输出,来自 apache 和系统调用,但也许您会发现一些有趣的东西。strace -o <filename>
您可以将strace
输出写入文件,这使得后期处理变得更加容易。
答案3
事实证明,mysql 占用了大量内存,超出了 VPS 的限制,从而导致 httpd 崩溃。我之前运行的是 wordpress。今天早上我已将其删除,内存已恢复到合理水平。我们将看看崩溃是否还会继续。感谢您的帮助,我学到了很多东西!