How to block an IP address
First, get a website. Got that? Good.
Now, make sure you have some sort of Apache server. If you're not sure you have one, the rest of this won't make much sense, so just go back and let your kid read the rest of this.
For those of you still with me, you'll need to upload a file to your server called an .htacccess file. It's simply an extension that tells the server what to do with all your files (Here's some info from Apache). This is where the magic happens.
Inside that .thaccess file, you set up some variables to create certain events. If you use WordPress like I do, there is one uploaded when you install it. It's in the top-level directory, just sitting there. If you open the file, you'll see there's some WordPress specific code. THIS IS NOT THE SAME WITH OTHER BLOGGING SOFTWARE OR CMS'. In fact, the part that WordPress uses doesn't really have much effect on what I'm doing.
I found this at JavaScript Kit, and it's a wonderful way to keep the spammers, scammers, and scrapers off your site. Inside your .htaccess file, put this:
order allow,deny deny from 123.45.6.7 deny from 012.34.5. allow from all
Obviously, you put in the people you want to block in there. How, then, do you find out whom to block? Using your server logs (WordPress doesn't have a native server log, but you could get Counterize or SlimStat, depending on your skill level and desires). Simply find the offending IP address, and block it.
Now, if you're wondering why I'm sharing my deep, dark industry secret, it's because I thought that I'd finally won the war against the spammers. I thought that I'd finally got them to stop messing with my site. I thought that they finally figured out that there's nothing - NOTHING - for them to find here.
I was wrong.
This morning, I checked the server logs, and found that I was being visited by two different servers showing up from the same pages, crawling the site. Those pages were http://www.macstansbury.org/alliance-of-the-anonymous and http://www.macstansbury.com. Go ahead, copy and paste the .org one into a new window, and see what you get. I'll wait here patiently.
What, it didn't take you to where you thought it did at all? So, how then, can I be getting anyone coming from that page to such specific pages? It's because it isn't coming from that page at all.
It's called spoofing. It's what spammers do. I hate spammers. I block spammers.
That's what I did. I used that great method I found to deny users by IP, and blocked the thing. No regrets. Not like that guy would've found anything, anyway - I tend to keep this site locked down pretty tight.
More stuff like this brief tutorial, and lots of cussing, found at A Daily Rant.
status: published
lastmod: '2006-10-01T01:02:03.000Z'
author: John Stansbury
cms: wordpress
custom:
podPressPostSpecific: 'a:6:{s:15:"itunes:subtitle";s:15:"##PostExcerpt##";s:14:"itunes:summary";s:15:"##PostExcerpt##";s:15:"itunes:keywords";s:17:"##WordPressCats##";s:13:"itunes:author";s:10:"##Global##";s:15:"itunes:explicit";s:7:"Default";s:12:"itunes:block";s:7:"Default";}'
_utw_tags_0: 'a:3:{i:0;O:8:"stdClass":1:{s:3:"tag";s:9:".htaccess";}i:1;O:8:"stdClass":1:{s:3:"tag";s:4:"rant";}i:2;O:8:"stdClass":1:{s:3:"tag";s:18:"social-engineering";}}'
similarterms: server file block spammers found thought site deny wordpress find pages finally inside address rest coming http logs macstansbury apache