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 -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Mod_GeoIP question, how to block cities
Author
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Mon 18 Nov '13 19:32    Post subject: Mod_GeoIP question, how to block cities Reply with quote

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

PostPosted: Mon 18 Nov '13 22:22    Post subject: Reply with quote

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

PostPosted: Tue 19 Nov '13 1:54    Post subject: Reply with quote

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 Very Happy
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Tue 19 Nov '13 2:04    Post subject: Reply with quote

Looks like GEOIP_Region is what I will want to use to block access by state per the document located at:

http://dev.maxmind.com/geoip/legacy/mod_geoip2/

-S
Back to top


Reply to topic   Topic: Mod_GeoIP question, how to block cities View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules