Apache / Zend框架-错误日志-未找到页面


Apache / Zend Framework - Error Log - Page Not found

这个让我有点困惑。

我正在运行一个LAMP服务器与Zend框架。我花了很多时间查看我的错误日志,试图清除任何编程错误/bug。

我的大多数特定站点错误都完成了,但我查看了我的通用Apache错误日志:

/var/log/apache2/error.log

我看到了很多,几乎恒定的,错误的"文件不存在",像下面(简化为简洁):

[date] [error] [client #:#:#:#] File does not exist: /var/www/sites/[website folder]/public/explore
[date] [error] [client #:#:#:#] File does not exist: /var/www/sites/[website folder]/public/where-to-buy
[date] [error] [client #:#:#:#] File does not exist: /var/www/sites/[website folder]/public/products

以此类推。这些文件夹不存在,因为所有请求都被重定向到index.php文件中,并由Zend Framework处理。实际的控制器和操作是存在的,这样任何人都可以:

http://www.example.com/explore

http://www.example.com/where-to-buy/

将通过Zend Framework得到正确的页面。

但是我不明白为什么所有这些错误都会发生?

它可能与。htaccess文件有关,该文件将大多数请求(不包括样式表,文档,图像等)重定向到index.php脚本。我的是这样的:

RewriteEngine On
# make sure all requests go to 'www' sub-domain
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# Zend Framework, redirect requests to index.php
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

是Apache试图通过一个实际的目录首先解决请求,然后传递请求到index.php?是什么导致了错误请求?

我也不知道为什么这被转储到默认的错误日志,而不是错误日志或特定的网站。换句话说,我有每个域的错误日志,例如"example.com_error.log"。这可能是这个问题的另一个迹象。这可能是一个顺序的事情,因为"error.log"是一个"默认"的网站。

谢谢你的建议!问好

From Regilero:

将进入默认日志的事实实际上是一个很好的提示如果有问题,请查看相关的access.log。也许会提出一些要求您的虚拟主机或web客户端无法处理的DNS名称使用HTTP 1/1(所以没有主机头)- regilero Oct 19 '11 at 22:52

我可以比较access.log和error.log来调查我的问题

这是一段时间以前,但我相信这个问题是由于一些脚本直接通过IP地址到服务器,并试图使用目录结构从一个虚拟托管域。