Project

General

Profile

Bug #1949

mod_geoip not setting environmental variables

Added by rolando over 8 years ago. Updated 9 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
3rd party
Target version:
Start date:
2009-03-24
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

Compiled mod_geoip as stated in the ModGeoip Docs, but it's not setting the env as it should, the lighty config:

server.modules = (
...
"mod_geoip",
...
)

geoip.db-filename = "/usr/share/GeoIP/GeoIP.dat" 
geoip.memory-cache = "enable" 

to test that if module is working, I'm using this script:

#!/usr/bin/env ruby

require 'pp'
require 'rubygems'                                                                                   
require 'geoip'                                                                                      

pp ENV
DB = GeoIP.new("/usr/share/GeoIP/GeoIP.dat")
country = DB.country(ENV['REMOTE_ADDR'])                                                             
pp country

the ENV shows nothing about geoip, but the same database, using the ruby bindings of the geoip library, works as supposed. Testing using the ubuntu 8.10 lighttpd package.

History

#1

Updated by stbuehler over 8 years ago

  • Target version deleted (1.4.19)

How can you test with the ubuntu package if you needed to compile it yourself?

And 1.4.19 is pretty old... try it again with 1.4.22

And "Target version" is not the same as "affected version".

Apart from that mod_geoip is still a third pary module and not officially supported.

#2

Updated by rolando over 8 years ago

since the only way to install mod_geoip is to compile it, I used debian-based tools (read: apt) to get the source, recompile and create another .deb package.
I will have to recompile and install by hand a newer version and test it. Although, you might want to check the forums, since there's another person with the same issue.

#3

Updated by natethelen over 8 years ago

I am also seeing this using fast-cgi and flup (python). I have traced it back to the raw socket read and none of the GEOIP_* FCGI_PARAMS are being sent through. What is weird is that they are passed through to PHP when run via fast-cgi with all else equal on the same box

#4

Updated by gstrauss over 1 year ago

  • Category set to 3rd party
  • Status changed from New to Missing Feedback

mod_geoip adds variables to an environment array internally and that array is what is used for CGI, FastCGI, and SCGI, so if it is working in some cases and not others, I would suggest looking at your module load order to make sure geoip is run before those modules.

I uploaded a version of mod_geoip to https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModGeoip which compiles against lighttpd 1.4.39.

If this is still an issue for you, please reopen ticket with more details on how to reproduce.

#5

Updated by gstrauss 9 months ago

  • Status changed from Missing Feedback to Fixed
  • Target version set to 1.4.46

Fixed in f5356302 (regardless of module ordering, as long as dynamic handlers run in the handler hook)

Also available in: Atom