每个星期天3点阿帕奇重新开始。问题是:服务器上有一个带有加密私钥的证书。由于在自动重新启动过程中没有提供密码,apache会停止,我的所有网站都会关闭。
我想阻止阿帕奇每周重新开始。多么?这是当时的apache日志。在[notice] caught SIGTERM, shutting down
之前没有什么关系,如果你想知道.
[Sun Feb 15 03:37:12 2015] [notice] caught SIGTERM, shutting down
[Sun Feb 15 03:37:12 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Feb 15 03:37:13 2015] [error] Init: Unable to read pass phrase [Hint: key introduced or changed before restart?]
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218640442 error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 67710980 error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218529960 error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
[Sun Feb 15 03:37:13 2015] [error] SSL Library Error: 218595386 error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
[Sun Feb 15 11:09:41 2015] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Feb 15 11:09:44 2015] [notice] Digest: generating secret for digest authentication ...
[Sun Feb 15 11:09:44 2015] [notice] Digest: done
[Sun Feb 15 11:09:44 2015] [notice] FastCGI: wrapper mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Feb 15 11:09:44 2015] [notice] FastCGI: process manager initialized (pid 11309)
[Sun Feb 15 11:09:44 2015] [notice] Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_fastcgi/2.4.6 configured -- resuming normal operations
更多信息:
/usr/sbin/raid-check
这是周日晚上(凌晨1点)唯一运行的Cron作业,但是如果我手动运行它,Apache就不会发生任何事情。发布于 2015-02-15 13:05:22
可能的原因是log旋转式脚本中的postscript。这就是在日志旋转之后运行的脚本。应该调用/etc/logrotate.d/apache2或/etc/logrotate.d/httpd (取决于发行版),并类似于:
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
相关部分是‘服务httpd重新加载’。解决这一问题的一种方法是只删除最后4行(从sharedscript到endscript,包括这两行)。另外,添加版权截断选项,这样您的日志旋转脚本将变成:
/var/log/httpd/*log {
copytruncate
missingok
notifempty
}
复制截断将消除apache重新启动的需要,因为它将复制日志文件的内容,然后将其归零,因此文件描述符将保持不变,apache进程不会注意到任何更改。
若要测试日志旋转,请运行:
logrotate -f /etc/logrotate.d/httpd
此外,考虑设置没有密码的私钥,因为这是错误的做法,很明显,您现在已经看到了为什么:)
https://serverfault.com/questions/667790
复制相似问题