Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Deny access to certain IP addresses???

Status
Not open for further replies.

PeabsB

Technical User
Jan 26, 2002
1
US
Hi everyone, I am new here... unfortunately i'm also quite new to linux and apache... I know that I use the Deny directive in the httpd.conf file to deny access to certain IP addresses, but where do I put this within that file?? Thank you
 
Hi,

You just put a couple of lines into either a <Directory> container within httpd.conf for the directory concerned, or a .htaccess file placed in the directory itself. For example :

<Directory /whatever>
order deny,allow (the default order)
allow from 192.168.0.0/255.255.255.0
deny from all
</Directory>

[only allows from the 192.168.0.x subnet]

<Directory /whatever>
order allow,deny
deny 192.168.0.1
allow from all
</Directory>

[allows all except IP address 192.168.0.1]

See -->
Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top