Re: Question about blocking IP's
- From: Robert Harris <robert.f.harris@xxxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 17:58:21 GMT
nestor_kun@xxxxxxxxxxx wrote:
There shouldn't be any problem at all to use iptables to block a certain IP address (as in:Greetings all, And sorry for newbie question. I was playing around with my PC which has Vector Linux and Apache installed to it. (Vector Linux is based on Slackware, pretty much the same)
I tried to block certain IP address accessing the homepage I'm hosting with apache. I used IPTABLES for this. But I realized that the effect was short lasting, even I didn't restart or anything.
iptables -A input -p tcp --dport 80 -s <source address to block> -j DROP
at an appropriate place)
Your web server probably won't use your hosts.deny file (unless it is invoked through tcpwrappers from inetd.conf). Your apache configuration file (something like /etc/apache2/apache2.conf or /etc/apache/httpd.conf) can use a line like:
So my question is, what is the best way to stop a visitor from certain IP address to my firewall.
Can I simply add the IP addresses to my hosts.deny file? It would be the easiest way.
Deny from 192.168.0.2
in the right place to deny access from IP address 192.168.0.2
The apache manual at <http://httpd.apache.org/docs/> will tell you all about it.
Robert
I'm using Midnight Commander and the editor of that. I understand I should leave empty line to end of that file, is that correct?
Thank you for those who bother to write something useful.
.
- Follow-Ups:
- Re: Question about blocking IP's
- From: yas_chan
- Re: Question about blocking IP's
- References:
- Question about blocking IP's
- From: nestor_kun
- Question about blocking IP's
- Prev by Date: QoS and shaping
- Next by Date: Re: Routing problem
- Previous by thread: Question about blocking IP's
- Next by thread: Re: Question about blocking IP's
- Index(es):
Relevant Pages
|