How to block specific IP address(es) access to my webserver?

Joined
Mar 3, 2013
Messages
16
Reaction score
0
Points
1
Hi;

I run a small personal website on a Mac Mini at home. Using 2010 Mac Mini Server w/ OS X 10.9.2 and latest OS X Server, Apache Web Server 2.2x.

Would like to be able to block some specific IP addresses that are using a lot of bandwidth (spiders, hackers, etc.) from accessing the site and possibly the IP address on the public side.

Is there a way to redirect specific addresses into some sort of a black hole, with no error message - just ... nothing?

Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Looks like you want Apache's access control functionality (see here).
 
OP
T
Joined
Mar 3, 2013
Messages
16
Reaction score
0
Points
1
Thanks, but that's not very helpful. Not even sure where those settings would go.

Is there a way to block at the firewall? I'm using Airport Extreme (5th Gen)

Thanks.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Those settings go in your httpd.conf file (so, /etc/apache2/httpd.conf...I think, I'm away from my Mac right now).

I'm not sure how the sever app works but evidently there's a hardware section in the server app that lets you tweak with the Airport device on the Mac itself. From what I've seen, there's a bit of control there for blocking things.
 
OP
T
Joined
Mar 3, 2013
Messages
16
Reaction score
0
Points
1
That was simpler than I thought. I was able to add a directive (if that's the right term) like "DENY xxx.yyy.zzz.aaa" for the address. directly to the httpd.conf file in etc/apache2. For some reason, all the other references I had seen were saying to refer to files inside other files and defined elsewhere, yadda yadda. Hopefully this will work. Seems a lot more direct that other methods at least.

Thanks!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top