PDA

View Full Version : Weird "File not found" notices in logs


LiteSpeeder
04-12-2012, 10:44 AM
Hello,

I've been noticing these errors in the server log viewer for a very long time. I checked/searched all of my templates, html, php, js files and even my database via sql queries but i couldn't find any clues regarding the source of the notices below.

For example there are no links referring to "http:/xx.xxxxxx.xxx/mobile.png/" which is a theme element/image. I can see the image with the correct link on my site through every browsers.

These notices are always in logs with different IPs and i think it may be related to lsws.

Does it cause any performance issues if 10% of visitors (maybe robots) request these "not found" files? How can i fix it?


INFO [95.9.55.240:2983-0#APVH_xxxxxx.xxx] File not found [/home/xxxxxx/public_html/"http:/xx.xxxxxx.xxx/theme/buttons/printer.gif/"]

INFO [95.9.55.240:2989-0#APVH_xxxxxx.xxx] File not found [/home/xxxxxx/public_html/"http:/xx.xxxxxx.xxx/mobile.png/"]

INFO [95.9.55.240:2987-0#APVH_xxxxxx.xxx] File not found [/home/xxxxxx/public_html/"http:/xx.xxxxxx.xxx/theme/buttons/collapse_thead.gif/"]

INFO [95.9.55.240:2985-0#APVH_xxxxxx.xxx] File not found [/home/xxxxxx/public_html/"http:/xx.xxxxxx.xxx/theme/buttons/sendtofriend.gif/"]

webizen
04-12-2012, 04:56 PM
LSWS would not manipulate URL. maybe you have rewrite rules generating something like http://domain/"http:/xx.xxxxxx.xxx/theme/buttons/sendtofriend.gif/". enable rewrite log to see this is the case. Or your application does that.

LiteSpeeder
04-13-2012, 12:16 AM
How can i enable rewrite log?

webizen
04-13-2012, 08:06 PM
add "RewriteLogLevel 9" in httpd.conf and restart lsws. It will be logged in /usr/local/apache/logs/error_log with '[REWRITE]' like following.


2012-04-09 23:17:34.451 [INFO] [10.8.0.6:55091-0#APVH_test.com] [REWRITE] strip base: '/' from URI: '/'

LiteSpeeder
04-14-2012, 03:53 AM
I put it right after 'RewriteEngine on' in httpd.conf but it says "/usr/local/apache/conf/httpd.conf:567: Directive 'RewriteLog' is not allowed in current context." when i restart lsws.

<Directory /home/xxxxxx/public_html>
Options All -Indexes
Header unset ETag
FileETag None
RewriteEngine on
RewriteLogLevel 9
RewriteCond &#37;{HTTP_HOST} !^www\.xxxxxx\.xxx
RewriteRule (.*) http://www.xxxxxx.xxx/$1 [L,R=301]
</Directory>

NiteWave
04-14-2012, 08:43 AM
per
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriteloglevel
Context: server config, virtual host

however, your
RewriteLogLevel 9
is in a "directory" context. try move it out of
<Directory /home/xxxxxx/public_html>
...
</Directory>

i.e.,

RewriteLogLevel 9
<Directory /home/xxxxxx/public_html>
Options All -Indexes
Header unset ETag
FileETag None
RewriteEngine on
RewriteCond &#37;{HTTP_HOST} !^www\.xxxxxx\.xxx
RewriteRule (.*) http://www.xxxxxx.xxx/$1 [L,R=301]
</Directory>

LiteSpeeder
04-14-2012, 09:36 AM
Thank you. I enabled it. But it doesn't display any results:

tail -f /usr/local/apache/logs/error_log|fgrep '[rewrite:'

tail -f /usr/local/apache/logs/error_log|fgrep '[REWRITE:'