Re: Question about blocking IP's



nestor_kun@xxxxxxxxxxx wrote:
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.
There shouldn't be any problem at all to use iptables to block a certain IP address (as in:

iptables -A input -p tcp --dport 80 -s <source address to block> -j DROP

at an appropriate place)

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.
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:

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.

.



Relevant Pages

  • Re: Question about blocking IPs
    ... And sorry for newbie question. ... I was playing around with my PC which ... has Vector Linux and Apache installed to it. ... IP address to my firewall. ...
    (comp.os.linux.networking)
  • Question about blocking IPs
    ... And sorry for newbie question. ... I was playing around with my PC which ... has Vector Linux and Apache installed to it. ... IP address to my firewall. ...
    (comp.os.linux.networking)
  • REQ: Xinetd configuration for Apache and Postfix
    ... sorry for my newbie question. ... OS Linux Suse 7.3 ... 1000 apache users/day ... 50 postfix users ...
    (Security-Basics)
  • probes to port 80
    ... I'm just playing with Apache. ... Spade site did not uncover much ..only a reverse dns lookup for IP ... For most request for these kinds of files I've ...
    (alt.computer.security)
  • Re: Question about blocking IPs
    ... > And sorry for newbie question. ... I was playing around with my PC which ... > has Vector Linux and Apache installed to it. ... > should leave empty line to end of that file, ...
    (comp.os.linux.networking)