This one is a little confusing to me.
I’m running a LAMP server with Zend Framework. I’ve spent a lot of time going over my error logs to try and clean-up any programming errors/bugs.
Most of my specific site errors are done but I looked into my general Apache error log:
/var/log/apache2/error.log
And I’m seeing a lot, almost constant, errors for “File does not exist” like the following (simplified for brevity):
[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
And so on. These folders do not exist because all requests are suppose to be redirected into the index.php file and handled by Zend Framework. The actual controllers and actions exist, such that anyone going to:
http://www.example.com/explore
or
http://www.example.com/where-to-buy/
will get the correct page via Zend Framework.
But I’m not understanding why all these errors are occuring?
If figure it might have something to do with the .htaccess file that redirects most requests (excluding style sheets, documents, images, etc) to the index.php script. This is what mine looks like:
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]
Is Apache trying to resolve the request via an actual directory first and then passing the request to index.php? Which causes the error request?
I’m also not sure why this is getting dumped into the default error log, instead of the error log or the specific site. In other words, I have error logs for each domain such as “example.com_error.log”. That might be another indication to the issue. It might be a sequence thing as “error.log” is tired to a “default” site.
Thanks for any insight!
Fozzy
From Regilero:
I was able to compare the access.log with the error.log to investigate my issues.
It was awhile ago but I believe the issue was due to some script going directly to the server via an IP address and trying to use the directory structure from one of the virtually hosted domains.