Mobile app version of vmapp.org
Login or Join
Annie201

: Using SetEnvIf to not log overly accessed URLs I'm trying to figure out how to craft my SetEnvIf's in my apache config so that the server hard disk isn't spinning 24/7 over log entries. What

@Annie201

Posted in: #Apache #Htaccess #Logging #Performance

I'm trying to figure out how to craft my SetEnvIf's in my apache config so that the server hard disk isn't spinning 24/7 over log entries.

What I want to do is disable logging for all domains and subdomains the server has DNS records for, however, on the example.com domain, I want it where requests to the root (a.k.a. example.com/) not be logged since that's frequently accessed.

This is what I have so far as httpd.conf code but I'm not sure how to modify it to satisfy my criteria above.

SetEnvIf Host "^example.com$" nolog
SetEnvIf Request_URI !/ !nolog
SetEnvIf Host "^???$" nolog
CustomLog /var/log/httpd/access_log common env=!nolog


Later I may think about no longer logging PHP file access as I don't want potential hackers to flood my log files anymore.

How do I adjust my code to satisfy my requirements?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme