logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Block the IP for one hour if it accessed certain file
Author
takfuji



Joined: 09 Mar 2016
Posts: 7
Location: JP

PostPosted: Tue 21 Feb '17 2:38    Post subject: Block the IP for one hour if it accessed certain file Reply with quote

Am using Apache 2.4. Want to deny accesses from scrapers for, say, one hour. How can I do it?
Have one file hidden in the index page to detect a scraper, so, what I want to do is:

"Block the IP which accesseed this file for one hour."

Looked into Apache documentation spending two days but could not find appropriate directive so far.
Bast regards. Tak
Back to top
Nigel-Aves



Joined: 21 Feb 2017
Posts: 3
Location: US, CO, Longmont

PostPosted: Tue 21 Feb '17 17:11    Post subject: Use Firewall Reply with quote

Your best solution is to use the firewall as a block.

I don't have the same issue as yourself, but I believe you can use mod_security to protect a directory (this will block IPs), but from there it's best to pass the mod_security log to fail2ban that can then interact at the firewall level.

Hope this points you in a good direction.
Back to top
takfuji



Joined: 09 Mar 2016
Posts: 7
Location: JP

PostPosted: Wed 22 Feb '17 0:45    Post subject: Reply with quote

Thanks, Nigel-Aves,
Am not familiar with fail2ban. Will look into it in detail.
Have just glanced the fail2ban page now, it looks promissing.
Tak
Back to top
maba



Joined: 05 Feb 2012
Posts: 64
Location: Germany, Heilbronn

PostPosted: Sat 25 Feb '17 17:19    Post subject: Reply with quote

Also depends on the platform.

On Linux you can use iptables to do quite sophisticated rules. But ApacheLounge is more Windows oriented.

On Windows you would have to script things yourself.
Back to top
takfuji



Joined: 09 Mar 2016
Posts: 7
Location: JP

PostPosted: Sun 26 Feb '17 0:56    Post subject: Reply with quote

Am on Windows. Found that the fail2ban is not for Windows.
Thanks anyway.

Almost giving up and taking an alternative to limit bandwidth for the specific IP.
Tak
Back to top


Reply to topic   Topic: Block the IP for one hour if it accessed certain file View previous topic :: View next topic
Post new topic   Forum Index -> Apache