我有 debian lenny,它位于防火墙后面,防火墙将端口从一个服务器/ip 地址重定向到我的服务器。我使用 apache 与请求跟踪器、trac、phpmyadmin、mysql 一起工作。它突然停止工作,我查看了日志,但无法弄清楚发生了什么,我想我遭受了某种攻击或自动实现灾难。我的服务器在星期五工作正常,今天星期一 apache 宕机了。当我尝试在 apache 错误日志中启动它时,我收到的主要错误是:
[Mon May 02 19:06:22 2011] [error] Couldn't load RT config file RT_Config.pm:\n\nRT_Config.pm did not return a true value at /opt/rt3/bin/../lib/RT/Config.pm line 585.\nCompilation failed in require at (eval 2) line 1.\n
[Mon May 02 19:06:22 2011] [error] Can't load Perl file: /opt/rt3/bin/webmux.pl for server rt.bambooscatwizard.com:0, exiting...
我还在星期六早些时候检查了 apache 的错误日志(之前的日志文件),并且一整天都遇到这样的错误(取出 ip,并将其替换为 SOME IP1 和 SOME IP2):
[Sat Apr 30 16:20:06 2011] [error] [client SOME IP] File does not exist: /var/www/NoAuth, referer: http://todasana.fondoavila.com:8180/trac/catwizard3/ticket/281
[Sat Apr 30 16:22:59 2011] [error] [client 157.82.156.137] File does not exist: /var/www/NoAuth, referer: http://todasana.fondoavila.com:8180/trac/catwizard3/ticket/244
其中条目的唯一区别是票号和时间。
我也遇到这些错误,但它们看起来像搜索引擎错误:
[Sat Apr 30 21:11:37 2011] [error] [client SOME IP2] File does not exist: /var/www/NoAuth
[Sat Apr 30 23:09:00 2011] [error] [client SOME IP2] File does not exist: /var/www/robots.txt
然后,文件中的最后一个错误(即星期一的错误)是:
[Sun May 01 07:45:44 2011] [notice] Graceful restart requested, doing restart
Traceback (most recent call last):
File "/usr/lib/python2.5/logging/__init__.py", line 744, in emit
msg = self.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 630, in format
return fmt.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 421, in format
s = self._fmt % record.__dict__
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 46: ordinal not in range(128)
Traceback (most recent call last):
File "/usr/lib/python2.5/logging/__init__.py", line 744, in emit
msg = self.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 630, in format
return fmt.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 421, in format
s = self._fmt % record.__dict__
UnicodeEncodeError: 'ascii' codec can't encode characters in position 46-49: ordinal not in range(128)
我认为很明显,最后的日志文件条目是导致我的 apache 被禁用的原因。
我检查了访问日志,SOME IP1 和 SOME IP2 分别来自:
SOME IP1 - - [01/May/2011:07:42:41 -0400] "GET /trac/catwizard3/ticket/208 HTTP/1.1" 200 5358 "http://todasana.fondoavila.com:8180/trac/catwizard3/timeline?from=2011-03-22T04%3A31%3A21Z-0400&precision=second" "Mozilla/5.0 (compatible; Steeler/3.5; http://www.tkl.iis.u-tokyo.ac.jp/~crawler/)"
SOME IP2 - - [01/May/2011:07:42:46 -0400] "GET /trac/catwizard3/browser/catWBackend3/tags/backend_r.3.1/trunk/backend/java-src/catw/out/production/catw/com/bamboo/catW3/DAO/impl/CategoryDAOImpl.class?rev=3 HTTP/1.1" 200 2517 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
所以我想知道你们是否能帮我恢复这个阿帕奇家伙,并帮我想想是什么让他不再为我的主人服务。谢谢!!
更新:
如果我禁用 rt,apache 可以正常工作,如果我启用 rt 的虚拟主机,它就会失败,这是 rt 的虚拟主机:
<VirtualHost *:80>
ServerName rt.bambooscatwizard.com
DocumentRoot /opt/rt3/share/html
PerlRequire "/opt/rt3/bin/webmux.pl"
<Location />
AddDefaultCharset UTF-8
SetHandler perl-script
PerlResponseHandler RT::Mason
</Location>
</VirtualHost>
答案1
检查/opt/rt3/lib/RT/Config.pm
。它以 结尾吗1;
?它被破坏了吗?
该 python 堆栈跟踪不提供任何信息。
我将禁用所有软件,然后逐个重新启用每个软件,以找出问题的原因。