我遇到了一个非常奇怪的问题。我正在使用 Apache2,并且设置了 VirtualHost。它正常工作,但在几次请求(4-5 次)后,我收到 403 错误。等待 10-20 秒后,页面再次开始工作。
这是我的 VirtualHost 记录。
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName subdomain.the-host.com
DocumentRoot /var/www/vhosts/subdomain.the-host.com/current/web
ErrorLog /var/log/apache2/subdomain.the-host.com-error.log
CustomLog /var/log/apache2/subdomain.the-host.com-access.log combined
<Directory /var/www/vhosts/subdomain.the-host.com/current/web>
Options +ExecCGI
AllowOverride All
Allow from all
</Directory>
LogLevel warn
ServerSignature On
</VirtualHost>
目录有www-data:www-data
所有权
以下是日志中的错误
[Tue May 21 15:14:57 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:14:58 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:14:58 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:14:59 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:14:59 2013] [error] [client 111.111.111.111] client denied by server configuration: /var/www/vhosts/subdomain.the-host.com/current/web/favicon.ico
[Tue May 21 15:14:59 2013] [error] [client 111.111.111.111] client denied by server configuration: /var/www/vhosts/subdomain.the-host.com/current/web/favicon.ico
[Tue May 21 15:14:59 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:14:59 2013] [error] [client 111.111.111.111] client denied by server configuration: /var/www/vhosts/subdomain.the-host.com/current/web/favicon.ico
[Tue May 21 15:14:59 2013] [error] [client 111.111.111.111] client denied by server configuration: /var/www/vhosts/subdomain.the-host.com/current/web/es, referer: http://subdomain.the-host.com/es/leatid
[Tue May 21 15:15:00 2013] [error] [client 111.111.111.111] client denied by server configuration: /var/www/vhosts/subdomain.the-host.com/current/web/favicon.ico
[Tue May 21 15:15:00 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
[Tue May 21 15:15:00 2013] [warn] [client 111.111.111.111] mod_fcgid: stderr: Empty module and/or action after parsing the URL "/favicon.ico" (/).
知道为什么 Apache 在 4-5 个请求后会失败吗?
答案1
您的 mod_fcgid 后端进程可能在请求完成后立即死亡。这不是正常情况,因此您需要找出 fcgi 死亡的根本原因,也许是脚本中的某些错误?我猜这与 /favicon.ico 的操作有关,也许您的脚本无法正确处理 404 错误或类似情况。