Jump to content


Photo

Restrict IP on Apache server


  • Please log in to reply
1 reply to this topic

#1 kaushikgotecha

kaushikgotecha
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 August 2006 - 06:01 PM

I have installed Apache 1.30 on my PC & it is serving on LAN now I want to restrict particular IP Addresses to access my server pl tell me How I can do it? if it is possible..

#2 youcantoo

youcantoo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 11 August 2006 - 09:53 PM

In your httpd.conf file you will want to add the following to your <Directory></Directory> container

Order Deny,Allow
Deny from xxx.xxx.xxx.xxx
Allow from all

For example:

<VirtualHost xxx.xxx.xxx.xxx>
ServerName mywebsite.com
<Directory /path/to/my/files>
Order Deny,Allow
Deny from IP number I want to block
Allow from all
</Directory>
</VirtualHost>


Don't forget to restart your webserver after making your changes.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users