How to remove messages out of ErrorLog?

Fix it!!

How to remove messages out of ErrorLog?

Postby jlc » Wed Jan 31, 2007 8:17 am

viewtopic.php?t=102&start=0&postdays=0&postorder=asc&highlight=vtibin

I was looking at this link, but I don't know enough about were to put rewrites to stop this logging. How can I get rid of these errors from my ErrorLog.

Code: Select all
wasuser@srea0101-v903:/logs/jas/sso> tail -100f error_log.1170201600 |egrep -i 'msoffice|vti_bin'
[Wed Jan 31 08:49:15 2007] [error] [client 10.230.73.254] File does not exist: /ort/jas/html/content/content.html1/_vti_bin
[Wed Jan 31 08:49:15 2007] [error] [client 10.230.73.254] File does not exist: /ort/jas/html/content/content.html1/MSOffice


I was able to remove them from the access.log with this in the httpd.conf

Code: Select all
SetEnvIf Request_URI "^/MSOffice/cltreq\.asp$" dontlog
SetEnvIf Request_URI "^/_vti_bin/owssvr\.dll$" dontlog

CustomLog "| /tools/IBM/ihs20/bin/rotatelogs /logs/jas/sso/access_log 86400" common env=!dontlog


Thank you,
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Postby richardk » Wed Jan 31, 2007 8:28 am

You could create them (empty file), redirect them, or rewrite them to a blank/404 file, or send a forbidden header but you can't just remove it from the log file.

To redirect them, put the following in a .htaccess file in your document root:
Code: Select all
Redirect 301 /MSOffice/cltreq.asp http://localhost/
Redirect 301 /_vti_bin/owssvr.dll http://localhost/


To rewrite them to a blank/404 file:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(MSOffice/cltreq\.asp|/_vti_bin/owssvr\.dll)$ /blank-or-404-file.html [QSA,L]


Forbidden header:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(MSOffice/cltreq\.asp|/_vti_bin/owssvr\.dll)$ - [F,L]


Some of these may still appear in the error log.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jlc » Wed Jan 31, 2007 8:44 am

Thank you, I'm still seeing it so maybe I'm missing something.

ls -l .htaccess
-rwxrwxrwx 1 wasuser wasgroup 556 Jan 31 10:36 .htaccess

cat .htaccess
Code: Select all
# To redirect them
Redirect 301 /MSOffice/cltreq.asp http://localhost/
Redirect 301 /_vti_bin/owssvr.dll http://localhost/

# To rewrite them to a blank/404 file
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(MSOffice/cltreq\.asp|/_vti_bin/owssvr\.dll)$ /blank-or-404-file.html [QSA,L]

# Forbidden header
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(MSOffice/cltreq\.asp|/_vti_bin/owssvr\.dll)$ - [F,L]


I still see the error if I click on the "Discussion" in IE.

Does this /blank-or-404-file.html need to be in the DocumentRoot dir so that it will send it there instead of the ErrorLog?

Thanks for your help.
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Postby richardk » Wed Jan 31, 2007 8:55 am

Does this /blank-or-404-file.html need to be in the DocumentRoot dir

You change it to anything you want, in any directory.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jlc » Wed Jan 31, 2007 8:59 am

Ok, I'm still seeing the errors in the ErrorLog.
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Postby richardk » Wed Jan 31, 2007 9:09 am

It shouldn't produce a 404 error as long as the file you rewrite to exists so i'm not sure why it's being logged, maybe you can't stop it.

Are you sure they're new errors?
Have you tried creating the blank files?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jlc » Wed Jan 31, 2007 9:12 am

I was just curious if you make the blank files in the dir by doing a touch if that matters

mkdir _vti_bin MSOffice

Code: Select all
[Wed Jan 31 11:06:31 2007] [error] [client 10.230.73.254] File does not exist: /ort/jas/html/content/content.html1/_vti_bin/owssvr.dll
[Wed Jan 31 11:06:31 2007] [error] [client 10.230.73.254] File does not exist: /ort/jas/html/content/content.html1/MSOffice/cltreq.asp


touch /ort/jas/html/content/content.html1/_vti_bin/owssvr.dll
touch /ort/jas/html/content/content.html1/MSOffice/cltreq.asp

Hit "Disscussion" no more errors.

Is this considered and UGLY fix :)

What could be the worst case that this would do? In the browser is just says it isn't available. I believe the reason we are seeing so many of these errors in production is because apparently users just have that option in IE on by default so when they hit it, are logs just fill up.
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Postby jlc » Wed Jan 31, 2007 9:15 am

richardk wrote:It shouldn't produce a 404 error as long as the file you rewrite to exists so i'm not sure why it's being logged, maybe you can't stop it.

Are you sure they're new errors?
Have you tried creating the blank files?


I touched the file

Code: Select all
wasuser@srea0101-v903:/ort/jas/html/content/content.html1> ls -l blank-or-404-file.html
-rw-r--r--   1 wasuser  wasgroup          0 Jan 31 10:43 blank-or-404-file.html


.htaccess

Code: Select all
wasuser@srea0101-v903:/ort/jas/html/content/content.html1> cat .htaccess


# To rewrite them to a blank/404 file
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(MSOffice/cltreq\.asp|/_vti_bin/owssvr\.dll)$ /ort/jas/html/content/content.html1/blank-or-404-file.html [QSA,L]
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Postby richardk » Wed Jan 31, 2007 9:22 am

The path in the RewriteRule should be relative to your document root. Then you shouldn't need to create the other files (if you have, i'm not sure).
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby jlc » Wed Jan 31, 2007 9:24 am

This might be why it isn't working, this is in httpd.conf

Code: Select all

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>


Should that be set to All or something else?
jlc
 
Posts: 8
Joined: Wed Jan 31, 2007 7:49 am

Next

Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 17 guests

cron