Is it possible to configure Apache2 to prevent logging any IP addresses or other information from user web requests, essentially making all users of a site anonymous?
Asked
Active
Viewed 170 times
2 Answers
5
You can write your custom logs as follow:
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
the %h
is the client ip address, just omit it:
LogFormat "%l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common

Giorgio Previtera
- 259
- 1
- 4
3
If you're going to run your logs through any standard stats processing tool, you'll want to put something else in place of the %h there, just to keep the log parsing happy. For example, you could do:
LogFormat "1.1.1.1 %l %u %t \"%r\" %>s %b" common
or similar, and that would log something there, but not the actual visitor's IP address.

Rich Bowen
- 171
- 2