Overclock.net banner
1 - 11 of 11 Posts

·
Premium Member
Joined
·
4,999 Posts
Discussion Starter · #1 ·
Someone has been spam downloading from me -_- I changed the filename of the file they were spam downloading and now they are just going to the old filename and getting 404 errors, how do I ban their ip with apache? I am on windows xp pro if that matters.
 

·
Premium Member
Joined
·
3,341 Posts
maybe some settings on your router (if you have one)
 

·
Registered
Joined
·
824 Posts
Been a while since I have used Apache (I could have this done in a half second in IIS...)

Your .htaccess file would look something like:

<Files *>
order allow,deny
deny from 127.0.0.1
allow from all
</Files>

Just replace 127.0.0.1 with the IP you want to block.
You can also block by domain - replace IP with "blah.com" (no quotes)

I think I remember always useing this directive too:

<Files .htaccess>
deny from all
</Files>

Also, your deny line can using masking or multiple entries.. I highly recommend against using domain names - else Apache has to go out and resolve names (big perf hit.)

So a deny line could look like:
deny from 127.0.0.1 127.0.0.2

Blocked two IPs.

Or:

deny from 127.0.0

You blocked that whole subnet.

You should also kill directory browsing using DirectoryIndex.
 

·
Premium Member
Joined
·
4,999 Posts
Discussion Starter · #9 ·
So basicly I have a file called .htaccess in my root folder and inside that folder i have

<Files *>
order allow,deny
deny from 127.0.0.1
allow from all
</Files>

where 127.0.0.1 is the ip I want to block.

Is that the only thing I have to do, or do I need to configure something else since im on windows?

EDIT: How do I make a file named .htaccess, it wont let me start a filename with a .
 

·
Registered
Joined
·
824 Posts
In notepad, put quotes around ".htaccess"

It will let you. (Wait, what OS are you on?)

Edit:
And ifn you really want to run apache, I recommend a move to *ux. Running it on Windows is like putting a Chevy engine in a Toyota.
Sure, it can work. But why try?
 

·
Registered
Joined
·
15 Posts
because satan

Sometimes a chevy smallblock in a lfited bob flat bed toyota running on 36 M/Ts with more armour than a bradley and more weight to drag over rocks is just simply needed.

besides the horsepower gains your also looking at a much cooler offroading rig.

oops this is a computer forumn
sorry

:)
 
1 - 11 of 11 Posts
Top