Clearing Large Apache Domain Logs

Are log files safe to delete?

Actually you are in a better position to answer your own question. Most of these logs are systems/application logs. I suggest you do some research to try to understand what are these logs file before you delete them.

But to free up disk space, I suggest instead of deleting, you should truncate these log file.

> /var/log/user.log
> /var/log/apache2/error.log

You can read more on rm vs truncate pro and cons.

How to make Apache stop log some my Urls

Thanks to Nick and Tarun. I resolved my problem.
In my .htaccess file, I add some configs:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^automate/phpfile1/(.*) ?call=phpfile1. processSomething&module=$1
RewriteRule ^automate/phpfile2/(.*) ?call=phpfile2.processSomethingElse&module=$1
</IfModule>

And in my httpd-vhosts.conf file, I set like below:

SetEnvIf Request_URI "^/automate/phpfile1/"  dontlog
SetEnvIf Request_URI "^/automate/phpfile2/" dontlog
CustomLog "logs/myapp.com-access.log" combined env=!dontlog

So, apache doesn't logging Uris :D



Related Topics



Leave a reply



Submit