LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to prevent local IP's in apache log? (https://www.linuxquestions.org/questions/linux-server-73/how-to-prevent-local-ips-in-apache-log-530042/)

esaym 02-17-2007 08:49 PM

How to prevent local IP's in apache log?
 
I would like to know how to prevent my local network ip's from showing up in the apache access logs. I can't find any documentation on it. I know there must be a way!


Thanks
Sam

IBall 02-17-2007 10:26 PM

You can use grep to remove your local ip addresses if you view the logs with cat:
Code:

cat /var/log/apache/access.log | grep -v "192.168"
--Ian

esaym 02-17-2007 10:53 PM

Quote:

Originally Posted by IBall
You can use grep to remove your local ip addresses if you view the logs with cat:
Code:

cat /var/log/apache/access.log | grep -v "192.168"
--Ian

Oh I didn't think about that.

However I did find out how to set apache right. I just had to add this to block my network ip's:

Code:

        SetEnvIf Remote_Addr "10\.36\.36" dontlog
        CustomLog /var/log/apache2/access.log combined env=!dontlog

Thanks!


All times are GMT -5. The time now is 03:38 AM.