Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Block access to websites via IP address?

Am running Yosemite Server 4.1 on 10.10.3.


I'm wondering if it is possible to block access to websites via their IP address, if I can do this via some type of config file, or whether it would have to be somehow done at the router level. I'm also interested if it could be done on a website by website basis, or whether it would have to be on a server level basis. Here's why:


I have some clients, well, the vast majority of my clients, who only sell within the United States. I get a lot of search engine traffic coming from Europe and Asia. I'd like to block these search engines from indexing the websites. Why?


It's not critical, but, if I can block them, it would make analysis just that much easier. I could take the log files "as-is" and not have to remove all of the non-US entries. Right now all visits get logged into a mysql database. I have to run a long sql statement to remove all those entries. Typically it's about 25-30% of all records. The way I see it, if I can block traffic that I don't want, a) it'll make analysis easier, and b) it would mean less traffic to the server, which is always a good thing, and c) it'd provide more useful data to Google Analytics.


If anyone knows of a way to do this, and can provide some easy to understand instructions, I'd be grateful.


Also...if anyone knows of a good reference book for running Yosemite server..........something that would be between the skimpy details that Apple provides and a 995 page monster manual that would totally confuse me...a link would be a good thing!


Thanks in advance for any assistance. For the older, non-super-technically inclined, this stuff isn't intuitive. I miss WebSTAR.

Mac mini, OS X Yosemite (10.10.3)

Posted on Sep 1, 2015 4:11 AM

Reply
1 reply

Sep 1, 2015 8:55 PM in response to Mr. Fubar

Nothing special about OS X Server... You block per site with apache config, modules or htaccess

Plenty of articles on the topic... Here's one (didn't read it, there may be others more relevant)

http://www.sitepoint.com/how-to-block-entire-countries-from-accessing-website/

or with the firewall (pf).. there are a couple GUIs that make it easy to block countries or use various block lists like the emerging threatslist.

http://www.hanynet.com/icefloor/

http://www.murusfirewall.com/

also worth considering.. fail2ban can monitor for malicious traffic (easily identifying bots) and temporarily block the source IP.

we use f2b to monitor/block malicous web traffic, smtp/imap/vnc/ssh/http failed auths, etc - its a great tool with many uses.

Lots of options. they all have pros/cons

Block access to websites via IP address?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.