Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Mod_GeoIP question, how to block cities |
|
Author |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
Posted: Mon 18 Nov '13 19:32 Post subject: Mod_GeoIP question, how to block cities |
|
|
I have my server configured using Mod_GeoIP to block access from certain countries and it is working flawlessly.
What I can't figure out is how to block cities using Mod_GeoIP.
Can someone on here give me a "sample config" to work with so that I may modify it and make it work to my needs.
Thank you in advance to all who can assist.
- Scott |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 18 Nov '13 22:22 Post subject: |
|
|
Wouldn't you just do the same as you do with countries and use GEOIP_CITY instead?
Code: | SetEnvIf GEOIP_COUNTRY_CODE RW BLACKLISTED
# Cities
SetEnvIf GEOIP_CITY Köln BLACKLISTED
SetEnvIf GEOIP_CITY Lakeside BLACKLISTED
SetEnvIf GEOIP_CITY "Los Angeles" BLACKLISTED
# Zip Codes
SetEnvIf GEOIP_POSTAL_CODE 92101 BLACKLISTED
SetEnvIf GEOIP_POSTAL_CODE 92107 BLACKLISTED
SetEnvIf GEOIP_POSTAL_CODE 92123 BLACKLISTED
<RequireAll>
Require all granted
<RequireNone>
Require env BLACKLISTED
</RequireNone>
</RequireAll> |
|
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
Posted: Tue 19 Nov '13 1:54 Post subject: |
|
|
Thank you Greg. I was not sue how to put in for cities or zip codes using GEOIP_CITY and GEOIP_POSTAL_CODE. Is there a GEOIP_State option?
Thanks for your help.
Next time I am in So Cal (LA area) I may have to make a trip to San Diego to buy you a beer |
|
Back to top |
|
DnvrSysEngr
Joined: 15 Apr 2012 Posts: 226 Location: Denver, CO USA
|
|
Back to top |
|
|
|
|
|
|