Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过apache“注意”(“GEOIP”u ADDR)获取用户的真实ip_Apache - Fatal编程技术网

通过apache“注意”(“GEOIP”u ADDR)获取用户的真实ip

通过apache“注意”(“GEOIP”u ADDR)获取用户的真实ip,apache,Apache,如何启用apache_note(“GEOIP_ADDR”);获取我客户的真实IP地址 我们的网站通过代理服务器运行,直到上周,我们才能够通过 $ip2=apache_note("GEOIP_ADDR"); echo $ip2; 对于那些不知道的人来说,这将是$headers[“X-Forwarded-For”]的一个很好的替代方案,但是我们最近无法做到这一点 下面是已加载Apache模块的列表 Loaded Modules: core_module (static) authn_file_

如何启用apache_note(“GEOIP_ADDR”);获取我客户的真实IP地址

我们的网站通过代理服务器运行,直到上周,我们才能够通过

$ip2=apache_note("GEOIP_ADDR");
echo $ip2;
对于那些不知道的人来说,这将是
$headers[“X-Forwarded-For”]
的一个很好的替代方案,但是我们最近无法做到这一点

下面是已加载Apache模块的列表

Loaded Modules:
 core_module (static)
 authn_file_module (static)
 authn_default_module (static)
 authz_host_module (static)
 authz_groupfile_module (static)
 authz_user_module (static)
 authz_default_module (static)
 auth_basic_module (static)
 file_cache_module (static)
 cache_module (static)
 disk_cache_module (static)
 mem_cache_module (static)
 include_module (static)
 filter_module (static)
 deflate_module (static)
 log_config_module (static)
 logio_module (static)
 env_module (static)
 expires_module (static)
 headers_module (static)
 setenvif_module (static)
 version_module (static)
 proxy_module (static)
 proxy_connect_module (static)
 proxy_ftp_module (static)
 proxy_http_module (static)
 proxy_scgi_module (static)
 proxy_ajp_module (static)
 proxy_balancer_module (static)
 ssl_module (static)
 mpm_prefork_module (static)
 http_module (static)
 mime_module (static)
 status_module (static)
 autoindex_module (static)
 asis_module (static)
 info_module (static)
 suexec_module (static)
 cgi_module (static)
 negotiation_module (static)
 dir_module (static)
 actions_module (static)
 userdir_module (static)
 alias_module (static)
 rewrite_module (static)
 so_module (static)
 bwlimited_module (shared)
 geoip_module (shared)
 php5_module (shared)
 pagespeed_module (shared)
Syntax OK
我失踪了

    GeoIPScanProxyHeaders On


地理位置
GeoIPScanProxyHeaders打开
geoipdfile/usr/share/GeoIP/GeoIP.dat MemoryCache
geoipdfile/usr/share/GeoIP/GeoLiteCity.dat MemoryCache
这导致真正的IP没有出现

现在,它应该可以正常工作了

<IfModule mod_geoip.c>
        GeoIPEnable On
        GeoIPScanProxyHeaders On
        GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache
        GeoIPDBFile /usr/share/GeoIP/GeoLiteCity.dat MemoryCache
</IfModule>