Web Hosting Forum
 
  #1  
Old 11-09-2003, 07:47 PM
Coordinator Coordinator is offline
NameMart.com
 
Join Date: Nov 2003
Location: New York
Posts: 265
Default How to block an IP

Hi
Does anyonw know how to block IP addresses on Apache server?
Reply With Quote
  #2  
Old 11-11-2003, 04:31 PM
nsomnia nsomnia is offline
Full Member
 
Join Date: Nov 2003
Location: Canada
Posts: 327
Default

Is it apache on Linux or Windows? If its on windows you can put it in your host file but if its Linux i wouldnt know I havnt really played around with it. I would suggest googleing it.
Reply With Quote
  #3  
Old 11-11-2003, 06:09 PM
Coordinator Coordinator is offline
NameMart.com
 
Join Date: Nov 2003
Location: New York
Posts: 265
Default

I'm Linux
Reply With Quote
  #4  
Old 11-11-2003, 06:29 PM
nsomnia nsomnia is offline
Full Member
 
Join Date: Nov 2003
Location: Canada
Posts: 327
Default

http://www.linuxsecurity.org
http://www.securityfocus.com
http://www.ipblocker.org/

also you have file /etc/httpd/conf/httpd.conf
There you should search for your domain options
something like this:

.
.
.
Allow from
Deny from
.
.
.


you have to restart your Apache after these modifications (not computer). So, you have to search for the script httpd and execute with parameter stop then with parameter start (also you can do it by once with parameter restart).

It is up to your system where is that file, but you should search in /etc/rc.d/*

One more thing, when you find that script run is like /etc/rc.d/*/httpd not just like httpd because this will probably start httpd from your "path" and nothings happen (that is case in Red Hat I don't know is it like that in other distros but it is easyer just to do right thing).
Reply With Quote
  #5  
Old 12-03-2003, 10:08 AM
Vivek Vivek is offline
Full Member
 
Join Date: Dec 2003
Location: Cardiff, UK
Posts: 341
Default

I dont know form apache server but it can be easily done with cpanel.
__________________
<<< Your signature contains broken links. Please fix your signature >>>
Reply With Quote
  #6  
Old 12-24-2003, 04:18 AM
Bluebellpeople Bluebellpeople is offline
Trainee
 
Join Date: Dec 2003
Posts: 8
Default Another solution

Another solution is to install a firewall on your linux server, you will have better control over it besides just blocking IP addresses to only Apache. You can protect your server in many ways.

Try "iptables" from http://www.netfilter.org/ for a start.
__________________
Warm Regards.
Ivan
Business Developement Manager
www.bluebellpeople.com
ivan.ng@bluebellpeople.com
Reply With Quote
  #7  
Old 12-24-2003, 04:59 AM
Vivek Vivek is offline
Full Member
 
Join Date: Dec 2003
Location: Cardiff, UK
Posts: 341
Default

cool.
__________________
<<< Your signature contains broken links. Please fix your signature >>>
Reply With Quote
  #8  
Old 01-19-2004, 02:08 PM
bambi bambi is offline
Trainee
 
Join Date: Jan 2004
Posts: 17
Default

it can be done easily thro. cp.
__________________
Bombay rules
Reply With Quote
  #9  
Old 07-28-2004, 05:56 PM
jackmaninov jackmaninov is offline
Trainee
 
Join Date: Jul 2004
Posts: 11
Default

if you have iptables already installed (usually the case for most default linux installs), just run the following from the shell, and put it in a startup script if you like:

iptables -I INPUT 1 -s IP.ADD.RES.SS -j DROP

-I INPUT 1 means to insert the rule at the top of the INPUT table (which means it will get looked at first)

-s IP.ADD.RES.SS is the source address of the packets we want to deal with

-j DROP means dump the packets into the void, and forget they ever happened.
Reply With Quote
  #10  
Old 07-28-2004, 06:24 PM
Wojjie Wojjie is offline
Full Member
 
Join Date: Jun 2004
Posts: 81
Default

Quote:
Originally Posted by jackmaninov
if you have iptables already installed (usually the case for most default linux installs), just run the following from the shell, and put it in a startup script if you like:

iptables -I INPUT 1 -s IP.ADD.RES.SS -j DROP

-I INPUT 1 means to insert the rule at the top of the INPUT table (which means it will get looked at first)

-s IP.ADD.RES.SS is the source address of the packets we want to deal with

-j DROP means dump the packets into the void, and forget they ever happened.
You can also do it by dropping the route, but I heard firewall is better to use :wink: (ie. iptables)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump

 


All times are GMT. The time now is 03:21 AM.
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Ad Management by RedTyger