Results 1 to 3 of 3

Thread: GeoIP Globally

  1. #1
    nux
    nux is offline Moderator
    Join Date
    Dec 2008
    Location
    Minneapolis
    Posts
    534
    Thanks
    28
    Thanked 77 Times in 54 Posts

    GeoIP Globally

    I was wondering if it's possible to configure GeoIP globally via the main httpd/apache.conf

    I've inserted this code in apache.conf:

    <IfModule mod_geoip.c>
    GeoIPEnable On

    GeoIPDBFile /usr/share/GeoIP/GeoIP.dat

    RewriteCond %{HTTP_USER_AGENT} !googlebot|Msnbot|Slurp|Teoma^$ [NC]
    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CN|IQ|NG|IR|SA|AG|MY|ID|CL|KW|AE|TR|RU|BR)$

    RewriteRule ^(.*)$ http://www.proxysites.net [L]

    </IfModule>

    And it doesn't seem to work.

    The same code does work in .htaccess though.

    This is on Cpanel which I'm not that familiar with, but I'm pretty sure it's inserted correctly.

    Any ideas/suggestions?

    Thanks,
    -nux
    Submit Your Proxies @ NewProxySites.com

  2. #2
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,329 Times in 1,259 Posts
    My first thought is that perhaps the code isn't in the right place in httpd.conf.

    Is it in the same part of httpd.conf as your other module configurations?

    Is all your Apache config in httpd.conf, or does your httpd.conf use include files?

    Is this CentOS?

    Did you restart Apache after making the change to httpd.conf?
    Last edited by Will.Spencer; 28 October, 2009 at 05:04 AM.
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  3. #3
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    That should work.

    Hmm, I've seen in the maxmind forums problems with things not working when mod_geoip is loaded before other modules like mod_rewrite or mod_setevif, so make sure mod_geoip is loading after everything else (I believe this is only important in Apache 1.3.x as 2.x allows modules to specifiy their own order, but it can't hurt). Also try adding a RewriteEngine on before the RewriteCond lines just to make sure mod_rewrite is getting activated.

  4. Thanked by:

    Will.Spencer (28 October, 2009)

Similar Threads

  1. [Free] FREE PHP GeoIP Country Redirect
    By crivion in forum Scripts
    Replies: 2
    Last Post: 15 March, 2010, 18:56 PM
  2. How to install GeoIP and block foreign traffic
    By Will.Spencer in forum Web Proxies
    Replies: 3
    Last Post: 6 December, 2009, 03:35 AM
  3. GeoIP tutorial - block countries..etc
    By Keldorn in forum Programming
    Replies: 0
    Last Post: 22 September, 2009, 08:58 AM
  4. GeoIP doesn't seem to be working?
    By Zash in forum Web Proxies
    Replies: 12
    Last Post: 25 July, 2009, 21:54 PM
  5. How to use GeoIP on glype ?
    By WebEvader in forum Web Proxies
    Replies: 6
    Last Post: 15 March, 2009, 18:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •