1

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?

caine
  • 11
  • 1

2 Answers2

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
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