Access Control Apache

104 Views Asked by At

Just having trouble setting an access control in Apache. So I want to deny access to a specific ip address for a section in my website. So when this ip address access my site, they shouldn't be able to see the "test" section of the website.

This is what I have done inside the httpd.conf file

<Directory /test>
Order Allow,Deny
Allow from all
Deny from 10.13.89.47
</Directory>

Please can someone tell me what I am doing wrong ?

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

Based on the information you have provided, you document root is '/' (very dangerous) or you've not understood how the 'Directory' tag works. I would expect the tag to look something more like.....

<Directory /srv/www/htdocs/test>
0
On

I have used something else to get it working.

<Location/test>
Order Allow,Deny
Allow from all
Deny from 10.13.89.47
</Location>