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 on Windows
Author
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Mon 12 Jul '10 10:04    Post subject: mod_geoip on Windows Reply with quote

Hello

I need to use mod_geoip http://www.maxmind.com/app/mod_geoip#block module to rewrite site requests to different leanguage site version. My Apache runs on Win2k3 server. Is there any way to make it work on windows ?

Maybe there is other way to do this ?

What I need is rewrites from mod_rewrite module for every request to my main page with IP country recognition. I will prepare three leanguage version of my site (danish, polish and english). If request comes from danish IP address it should be rewritten to www.myhost.com/dk/ (this will be site version in danish for danish IP addresses) same for polish www.myhost.com/pl/ (for polish IP addresses) and for english (all other IPs). Additionally i would like to keep mod_geoip feature which allows to block request from certain countries (f.x. China, Russia etc.).
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 12 Jul '10 12:49    Post subject: Reply with quote

For languages there is multiviews.
http://httpd.apache.org/docs/2.2/content-negotiation.html
The difference would be a English browser in Denmark will get English pages.
A Polish browser in Indonesia would get the Polish pages.

I like the module even with its occasional error that throws a 403.
With the CityLite DB it give decent info as environment variables;

_SERVER["GEOIP_CONTINENT_CODE"] NA
_SERVER["GEOIP_COUNTRY_CODE"] US
_SERVER["GEOIP_COUNTRY_NAME"] United States
_SERVER["GEOIP_REGION"] CA
_SERVER["GEOIP_REGION_NAME"] California
_SERVER["GEOIP_CITY"] Beaumont
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Mon 12 Jul '10 13:12    Post subject: Reply with quote

Thanks for your answer but what i need is URI change couse of google positioning. As I know this is the best way to site positioning in different leanguages. That's why i need to configure apache in this way - to make a different rewrites for different page visitors.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 12 Jul '10 15:41    Post subject: Reply with quote

That's fine. Docs say you can use environment variables for rewriting, there's the list of them when using the geoip module.
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 13 Jul '10 9:28    Post subject: Reply with quote

glsmith wrote:
That's fine. Docs say you can use environment variables for rewriting, there's the list of them when using the geoip module.


mod_geoip is not available for windows so how can i use environment variables of this module ?


maybe there is some possibility to compile this module for windows from linux sources ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 13 Jul '10 9:35    Post subject: Reply with quote

where did you get Apache? Apache.org, here, elsewhere? This will determine which one I point you too.
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 13 Jul '10 10:07    Post subject: Reply with quote

glsmith wrote:
where did you get Apache? Apache.org, here, elsewhere? This will determine which one I point you too.


From apachelounge.com
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 13 Jul '10 10:17    Post subject: Reply with quote

Apache Haus has what you want
www.apachehaus.com
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 13 Jul '10 13:30    Post subject: Reply with quote

glsmith wrote:
Apache Haus has what you want
www.apachehaus.com


OMG THIS IS WHAT I NEED - THANKS !!!!!! <dancing>

They need to reconsider google positioning Laughing
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 13 Jul '10 14:40    Post subject: Reply with quote

Qmpeltaty wrote:
glsmith wrote:
where did you get Apache? Apache.org, here, elsewhere? This will determine which one I point you too.


From apachelounge.com


Now i realized that my apache install comes from httpd.apache.org. Does it make any difference regarding to my mod_geoip thing ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 13 Jul '10 18:15    Post subject: Reply with quote

Yes, things built with VC9 do not always work well in Apache built on VC6, sometimes they do sometimes they do not. mod_geoip seems to be one that does not. So in this case now you have two choices,

as far as google positioning I agree, third page in seems unfair, especially with the keywords I used.

Edit: Updated link
Edit 2: removed dead link as I no longer have any vc6 built modules.


Last edited by glsmith on Sat 02 Sep '17 2:04; edited 4 times in total
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Wed 14 Jul '10 0:07    Post subject: Reply with quote

glsmith wrote:
Yes, things built with VC9 do not always work well in Apache built on VC6, sometimes they do sometimes they do not. mod_geoip seems to be one that does not. So in this case now you have two choices,

http://www.gknw.net/development/apache/httpd-2.2/win32/modules/mod_geoip2_1.2.5-2.2.10-w32.zip
http://us.apachehaus.com/files/apache22/mod_geoip-1.2.5-vc6.zip

as far as google positioning I agree, third page in seems unfair, especially with the keywords I used.


Which one is better for my installation ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 14 Jul '10 0:22    Post subject: Reply with quote

as far as I know they are the same. Both were built with VC6 which is what the apache.org distribution is built with.
Back to top
Schyzophrenic



Joined: 29 Jul 2012
Posts: 1

PostPosted: Sun 29 Jul '12 22:30    Post subject: Reply with quote

Thanks for all the information here. I got the apache module without any issue, but I can't find the C library compiled for windows 7 64bits anywhere.
This is getting pretty hard to install, anyone would have an idea of where I could get it ?

Thanks again for your help, it is pretty hard to find information on this...
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 30 Jul '12 21:06    Post subject: Reply with quote

Why do you need the C library? It's statically compiled into the module, at least the modules at Apache Haus
Back to top


Reply to topic   Topic: mod_geoip on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules