Compile GeoIP2 With OpenResty (Support?)

903 views
Skip to first unread message

Lim

unread,
Jul 4, 2018, 12:03:38 AM7/4/18
to openresty-en
Lately I tried to setup GeoIP2 with openresty, with lots of trying I didn't get it to compile. The machine is running x64 Debian 8.11.
The following error I'm receiving is: ./configure: error: the geoip2 module requires the maxminddb library. Compiling Under root.
Even though libmaxminddb is installed, and I did put in headers .h files in /usr/include.

By searching on the net, there have been other people coming across the same issue (though I don't think with openresty).
What they mentioned is that it's in the order which the modules is in ./configure by putting it before some modules or after it did work for some people.
I tried that by putting it before and after, and excluding every optional module in openresty and only compiled it with openresty + geoip2. Still I got the same error. and the library is located in:
whereis libmaxminddb
libmaxminddb: /usr/local/lib/libmaxminddb.la /usr/local/lib/libmaxminddb.a /usr/local/lib/libmaxminddb.so

So I thought, have anyone even compiled GeoIP2 with openresty, anyone with results? Or maybe there's a configuration error with openresty and geoip2 when you run ./configure.
Therefor I'm coming here. Looking for help, and hopefully not a issue by my part. I followed the instructions as stated.

Link to libmaxminddb (requirement): https://github.com/maxmind/libmaxminddb

Thanks hopefully there can be a workaround or a fix.

Igor Clark

unread,
Jul 4, 2018, 11:42:00 AM7/4/18
to openre...@googlegroups.com
Hello,

I make sure to run ldconfig when building GeoIP into OpenResty, to make sure Linux knows where to find the lib files. I build & install libmaxmind and then run ldconfig like so:
MAXMIND_INSTALL_PATH=/usr/share/maxmind
MAXMIND_LIB_PATH=${MAXMIND_INSTALL_PATH}/lib
MAXMIND_INC_PATH=${MAXMIND_INSTALL_PATH}/include
tar xzf libmaxminddb-1.1.2.tar.gz
pushd libmaxminddb-1.1.2
./configure --prefix=${MAXMIND_INSTALL_PATH}
make
make install
echo "${MAXMIND_LIB_PATH}" > /etc/ld.so.conf.d/libmaxminddb.conf
ldconfig -v 2>/dev/null |grep -i maxmind
popd
Probably needs a version bump but it works for me.

HTH,
Igor
--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lim

unread,
Jul 4, 2018, 10:34:26 PM7/4/18
to openresty-en
Actually worked! Thanks. I guess I should've included the paths to libmaxminddb when running openresty ./configure script before, I had to do that to make it work, I simply included the path to that folder and running ldconfig before, that was a fast workaround, thank you again.
Reply all
Reply to author
Forward
0 new messages