Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using apache 1.3.20-16 on my RH PC, now I would like to deny to access the page virtual host http://me.com from from any viewers of IP address 202.141.191.x PLease anybody help me how i can do this job???
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
I think you will need to setup some firewall rules... I don't think you can do that with apache itself.. Or you could write a cgi / php script to check the IP address and take proper action....
You can do it with an iptables rule in your firewall:
iptables -A INPUT -p tcp -s 202.141.191.0/24 --dport 80 -j DROP
This should prevent them from accessing your web server (assuming its running on port 80. If its not, change the rule to match your httpd port). Just make sure this rule is ahead of any other rule that might accept the packets.
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
This will prevent any access on port 80 from that IP range...
But i believe you want certain virtual hosts not to be available, but others should be? Then... Wow... That's hard I think...
I should go for some CGI-script / php page when entering your site...
Distribution: Red Hat 7.3, Red Hat 9, Solaris8, Slackware 10, Slax on USB, AIX, FreeBSD, WinXP, AIX, Ubuntu
Posts: 418
Rep:
Ahhhhh Dimitri is right on the money!!!
When i read it, i remembered it!
You should indeed read that, and then add something to your httpd.conf's virtualhost section like:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.