Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to block public access to apc.php file. Initially this configuration worked, now it doesn't. I know this is where the issue lies because when I comment out the ACL I can access the file just fine. Yes I've restarted the server on configuration changes. I've tried plenty of variants of allowing a host (using CIDR and the exact client IP).

<Files apc.php>
        Order Deny,Allow
        Deny from all
        Allow from 192.168.1
</Files>

and

[Mon Jun 11 08:00:51 2012] [error] [client x.x.x.x] client denied by server configuration: /var/www/html/apc.php
share|improve this question
    
By 'doesn't work', please clarify what you mean - what response code are you getting? –  Shane Madden Jun 11 '12 at 6:10

1 Answer 1

up vote 2 down vote accepted

You should change Order:

order allow,deny <- changed to make 'deny from' rules get applied after 'allow from'

and in allow from you must be more specific:

allow from 192.168.1.0/24

Your Config should look like this:

order allow,deny
deny from 192.168.0.37 allow from 192.168.0.0/16 <- removed the 'deny from all' - this will be implicit because of the 'order' directive above Satisfy any

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.