6

I want to block access to my web server by default as a precaution but I keep getting the following errors showing up in my error log.

[Wed Jun 27 23:30:54 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Edu.jar

[Wed Jun 27 23:32:40 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/REST.jar

[Wed Jun 27 23:35:39 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Set.jar

[Thu Jun 28 01:01:17 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxyheader.php

[Thu Jun 28 02:34:57 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxy.php

[Thu Jun 28 05:41:33 2012] [error] [client 58.218.199.227] client denied by server configuration: /home/www/default/proxyheader.php

[Thu Jun 28 06:55:10 2012] [error] [client 180.76.6.20] client denied by server configuration: /home/www/default/

[Thu Jun 28 07:31:26 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Edu.jar

[Thu Jun 28 07:32:25 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/REST.jar

[Thu Jun 28 07:36:10 2012] [error] [client 86.77.20.107] client denied by server configuration: /home/www/default/Set.jar

I don't really want these errors to show up but whatever I do, I can't get rid of them. Does anyone know how I can achieve this?

Here is a copy of my configuration.

<VirtualHost *:80>
    DocumentRoot /home/www/default

    <Directory />
           AllowOverride None
           Order Deny,Allow
           Deny from all
    </Directory>

    #ErrorLog /var/log/apache2/error.log
    #LogLevel warn
    CustomLog /var/log/apache2/access.log combined
</VirtualHost>

3 Answers 3

1

Have you tried

LogLevel crit

http://httpd.apache.org/docs/2.0/mod/core.html#loglevel

1
  • Just tried it out and it appears to work well :) Thanks!
    – Keith
    Jun 28, 2012 at 10:11
9

I found this question for the same reason, but I wasn't OK with hiding ALL error type logs, so I looked around and found out you can set the LogLevel of just a single module since Apache HTTP Server 2.3.6, so for the client denied requests, which use the access_compat module you can add this

LogLevel warn access_compat:crit

Which will set the default level to warn but only shows crit access_compat logs, this keeps your ability to see other error type logs

I know this is older, but I hope it's a better solution for others in the future.

2
  • Does not work on apache 2.2.15 el6. Maybe this works on apache 2.4?
    – bgStack15
    Dec 9, 2016 at 18:11
  • @bgStack15 This is definitely a feature new to Apache2.4, and not in Apache2.2 or earlier.
    – e_i_pi
    Jul 20, 2017 at 23:20
0

An alternative is to make use of Apache's piped logging feature and apply a filter before writing the log:

ErrorLog "|/bin/grep -v "client denied by server configuration" | /usr/local/apache/bin/rotatelogs /var/log/error_log 86400"
1
  • tried this and apache wouldnt restart Dec 4, 2015 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .