Mac Forums

Mac Forums (
-   OS X - Operating System (
-   -   How to block specific IP address(es) access to my webserver? (

tjod 04-15-2014 12:52 PM

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

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?


vansmith 04-15-2014 12:56 PM

Looks like you want Apache's access control functionality (see here).

tjod 04-15-2014 01:06 PM

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)


vansmith 04-15-2014 01:21 PM

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.

tjod 04-15-2014 04:05 PM

That was simpler than I thought. I was able to add a directive (if that's the right term) like "DENY" 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.


All times are GMT -4. The time now is 07:10 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.