Perl prg RewriteMap always returns blank

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello experts!

I'm working with a Perl script that should do geoIP mapping (IP to
two-letter country code). The script works perfectly on the command
line, and follows the rules highlighted in
https://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg

However, running from within Apache it always returns a blank value.

Only one line appears in the Apache error log even at LogLevel trace8

[Sat Oct 08 09:38:52.677116 2016] [rewrite:trace5] [pid 23318]
mod_rewrite.c(476): [client 85.205.37.101:46280] 85.205.37.101 - -
[<vhost>/sid#10092bc18][rid#100d28ca0/initial] map lookup OK: map=geoip
key=85.205.37.101 -> val=

Running the same IPs through the script manually does return values.

~ $ tail -f /var/log/apache/errors/error.log_20161008-09 | grep geoip
[Sat Oct 08 09:38:52.677116 2016] [rewrite:trace5] [pid 23318]
mod_rewrite.c(476): [client 85.205.37.101:46280] 85.205.37.101 - -
[<vhost>/sid#10092bc18][rid#100d28ca0/initial] map lookup OK: map=geoip
key=85.205.37.101 -> val=
[Sat Oct 08 09:38:54.290646 2016] [rewrite:trace5] [pid 23286]
mod_rewrite.c(476): [client 85.205.37.91:38384] 85.205.37.91 - -
[<vhost>/sid#10092bc18][rid#100cfb880/initial] map lookup OK: map=geoip
key=85.205.37.91 -> val=
[Sat Oct 08 09:38:57.889790 2016] [rewrite:trace5] [pid 23282]
mod_rewrite.c(476): [client 213.30.118.102:49939] 213.30.118.102 - -
[<vhost>/sid#10092bc18][rid#100d13940/initial] map lookup OK: map=geoip
key=213.30.118.102 -> val=
^C
~ $ /opt/apps/apache/conf/geoip_check.pl
85.205.37.101
DE
85.205.37.91
DE
213.30.118.102
PT
^C
~ $

I'm running Apache 2.4.18 on Solaris/SPARC and Perl 5.16.0. Compile-time
settings:

$ /opt/apache/current/bin/httpd -V
Server version: Apache/2.4.18-dev (Unix)
Server built:   Nov 20 2015 19:38:51
Server's Module Magic Number: 20120211:51
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_PROC_PTHREAD_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/opt/apache/apache-2.4.17-sparc-t64"
 -D SUEXEC_BIN="/opt/apache/apache-2.4.17-sparc-t64/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
$

Any ideas what could be going on here?

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux