I wan't to stop logging accesses from two of my local IPs, this is what I added to apache2.conf
:
...
<VirtualHost *:80>
SetEnvIf Remote_Addr "192.168.0.1" dontlog
SetEnvIf Remote_Addr "192.168.0.192" dontlog
CustomLog /var/log/apache2/access.log combined env=!dontlog
....
</VirtualHost>
Accesses from those two IPs still show up in my access.log
:
192.168.0.192 - - [31/Jan/2019:21:52:10 +0100] "GET /favicon.ico HTTP/1.1" 200 5859 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
It has been asked how to disable logging of certain IPs on this site a lot, but all questions were more or less answered by the approach above, but I still can't figure it out for the life of me. How can I get this to work or where can I see what's wrong? error.log
doesn't show any syntax errors, only the usual logs it produces on startup.
Yes, I have restarted apache after changing the file and it is up and running:
Active: active (running) since Thu 2019-01-31 21:52:07 CET; 12min ago
Edit:
apache2ctl -M
shows that setenvif_module (shared)
is enabled.
Edit 2: I don't know if this is relevant but in my
apache2.conf
following line exists:
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined