Overclock.net › Forums › Software, Programming and Coding › Networking & Security › How do I ban an IP from accessing my apache server?
New Posts  All Forums:Forum Nav:

How do I ban an IP from accessing my apache server?

post #1 of 11
Thread Starter 
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.
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
post #2 of 11
maybe some settings on your router (if you have one)
Rig 2.1
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 3770k ASUS P8Z77-V LK Sapphire 7850 1GB G.SKILL Ripjaws X 8GB (2 x 4GB) DDR3 F3-12800CL... 
Hard DriveHard DriveOptical DriveCooling
Western Digital Blue 1TB WD10EZEX Search Results Crucial MX100 CT256MX100SSD1 256GB ASUS DRW-24B1ST DVD±R/RW Zalman CNPS10X Optima 
OSMonitorKeyboardPower
Windows 7 Ultimate 64-bit Dell 23" IPS CM Storm Quick Fire Pro Brown OCZ StealthXStream 600W 
CaseMouseAudio
Antec P182 Logitech MX518 Logitech X-530 
  hide details  
Reply
Rig 2.1
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 3770k ASUS P8Z77-V LK Sapphire 7850 1GB G.SKILL Ripjaws X 8GB (2 x 4GB) DDR3 F3-12800CL... 
Hard DriveHard DriveOptical DriveCooling
Western Digital Blue 1TB WD10EZEX Search Results Crucial MX100 CT256MX100SSD1 256GB ASUS DRW-24B1ST DVD±R/RW Zalman CNPS10X Optima 
OSMonitorKeyboardPower
Windows 7 Ultimate 64-bit Dell 23" IPS CM Storm Quick Fire Pro Brown OCZ StealthXStream 600W 
CaseMouseAudio
Antec P182 Logitech MX518 Logitech X-530 
  hide details  
Reply
post #3 of 11
Thread Starter 
-_- there must be a better way.
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
post #4 of 11
I would also do it from the router assuming you have one.

Never used Apache on Windows, but if you are running it as a service, probably the same thing:
http://httpd.apache.org/docs/2.0/mod/mod_access.html
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
post #5 of 11
Thread Starter 
I saw that page before but I have no idea how to work that, do I just make a file called .htaccess?
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
post #6 of 11
Yeah, drop it in your root. Just use notepad or whatever.
(Put quotes around it when you save it as ".htaccess" so it won't append it with .txt)

Looking around, looks like on Windows you may need to edit the httpd.conf

This guy has an amusing writeup

http://forums.livingwithstyle.com/ar...t149577p1.html

Sorry, never done it on Windows.
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
post #7 of 11
Thread Starter 
so complicated, anyone have a zip or something with premade files im a lazy bum.
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
post #8 of 11
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.
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
post #9 of 11
Thread Starter 
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 .
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
FX-57 Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Athlon64 FX-57 DFI Lanparty NF4 SLI-DR EVGA 7950GX2 OCZ 2x1 GB 2-3-2-5 
Hard DriveOSMonitorKeyboard
74GB Raptor Windows Vista Ultimate Acer AL2216W 22" Widescreen Saitek Eclipse (Blue) 
PowerCaseMouseMouse Pad
680W Aspire Thermaltake Armor Logitech G5 Icemat v2 
  hide details  
Reply
post #10 of 11
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?
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
Toe Breaker
(17 items)
 
  
CPUMotherboardGraphicsGraphics
AMD FX-8350 Black Edition ASUS Crosshair V Formula-Z AM3+  ASUS R9270X-DC2T-4GD5  ASUS R9270X-DC2T-4GD5  
RAMHard DriveHard DriveOptical Drive
G.SKILL Ripjaws Series  Samsung 840 EVO-Series  Samsung 840 EVO-Series  ASUS 24x DVD-RW  
CoolingCoolingOSMonitor
Cooler Master Hyper 212 EVO  7x Phanteks PH-F140SP  Windows 8.1 ASUS VG248QE (x2) 
KeyboardPowerCaseMouse
Microsoft 4000 EVGA SuperNOVA 750G2 80PLUS  Phantek Enthoo Logitech G500  
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Networking & Security
Overclock.net › Forums › Software, Programming and Coding › Networking & Security › How do I ban an IP from accessing my apache server?