IP2Proxy Apache Module

This Apache module supports all IP2Proxy™ BIN database products for querying proxy IP addresses and retrieving information such as proxy type, country, region, city, ISP name, domain name, usage type, ASN, last seen in days, and threats. The detected proxy types include virtual private networks (VPN), open proxies, web proxies, Tor exits, data center & web hosting ranges (DCH), search engine robots (SES), residential proxies (RES), consumer privacy networks (CPN), and enterprise private networks (EPN). It requires IP2Proxy C Library.

Developers can download sample databases to evaluate the Apache module's functionality.

Installation
Unix/Linux
  1. Create a new folder called ip2proxy.
  2. Download IP2Proxy C library from here into the ip2proxy folder.
  3. Decompress C library.
    unzip master.zip
  4. Get into working directory.
    cd ip2proxy-c-master
  5. Start compilation.
    autoreconf -i -v --force
    ./configure
    make
    make install
  6. Download and decompress Apache module into the ip2proxy folder.
  7. Get into working directory.
    cd ip2proxy-apache-master
  8. Start compilation.
    apxs2 -i -a -L /usr/local/lib/ -I ../ip2proxy-c-master/libIP2Proxy/ -l IP2Proxy -c mod_ip2proxy.c
    ln -s /usr/local/lib/libIP2Proxy.so.1 /usr/lib/libIP2Proxy.so.1
  9. Add following lines into /etc/apache2/apache2.conf
    <IfModule mod_ip2proxy.c>
    	IP2ProxyEnable <On|Off>
    	# ENV will set server variables
    	# NOTES will set apache notes
    	# ALL will set both
    	IP2ProxySetmode <ALL|ENV|NOTES>
    	IP2ProxyDBFile <PATH_TO_IP2PROXY_BINARY_DATABASE>
    	IP2ProxyDetectProxy <On|Off>
    </IfModule>
Windows
  1. Create a new folder called ip2proxy.
  2. Download IP2Proxy C library from here into the ip2proxy folder.
  3. Decompress C library using 7-zip or other compression tools.
  4. Get into working directory.
    cd ip2proxy-c-master
  5. Start compilation.
    nmake /f Makefile.win
  6. Download and decompress Apache module into the ip2proxy folder.
  7. Navigate to ip2proxy-apache-master folder.
  8. Edit Makefile.win to change the path for C library.
    IP2PROXY_CSRC_PATH = C:/ip2proxy/ip2proxy-c-master/libIP2Proxy
    IP2PROXY_CLIB_PATH = C:/ip2proxy/ip2proxy-c-master/libIP2Proxy
    APACHE_INSTALL_PATH = "C:/Program Files/Apache Software Foundation/Apachex.x"
  9. Start compilation.
    nmake /f Makefile.win
  10. Copy ip2proxy_apache.dll generated to the Apache modules directory.
  11. Add following lines into httpd.conf
    <IfModule mod_ip2proxy.c>
    	IP2ProxyEnable <On|Off>
    	# ENV will set server variables
    	# NOTES will set apache notes
    	# ALL will set both
    	IP2ProxySetmode <ALL|ENV|NOTES>
    	IP2ProxyDBFile <PATH_TO_IP2PROXY_BINARY_DATABASE>
    	IP2ProxyDetectProxy <On|Off>
    </IfModule>
Module Settings
Name Description
IP2ProxyEnable ON | OFF. Enable or disable the IP2Proxy Apache Module.
IP2ProxySetmode ALL | ENV | NOTES. ENV will set the environment variables; NOTES will set the Apache NOTES variables; ALL will set both the ENV and NOTES variables.
IP2PRoxyDBFile Full qualified path to the IP2Proxy BIN database file.
IP2ProxyDetectProxy ON | OFF. If enabled, the module will detect the proxy IP address from X-Forwarded-For server variable. If disabled, IP address is from the REMOTE_ADDR server variable.
Sample Codes
Apache .htaccess
RewriteEngine On
RewriteCond %{ENV:IP2PROXY_IS_PROXY} ^Yes$
RewriteRule ^(.*)$ http://www.google.co.uk [L]
Apache Mod Security
SecRule ENV:IP2PROXY_IS_PROXY "Yes" "deny,status:500,id:5000888,msg:'Block visitor using proxy server'"
Sample IP2Proxy Databases (BIN)
Sample Packages - BIN File IPv4 + IPv6
IP2Proxy PX1 Download (20.69 MB)
IP2Proxy PX2 Download (23.17 MB)
IP2Proxy PX3 Download (27.55 MB)
IP2Proxy PX4 Download (32.29 MB)
IP2Proxy PX5 Download (33.72 MB)
IP2Proxy PX6 Download (34.01 MB)
IP2Proxy PX7 Download (36.69 MB)
IP2Proxy PX8 Download (37.84 MB)
IP2Proxy PX9 Download (37.69 MB)
IP2Proxy PX10 Download (45.43 MB)
IP2Proxy PX11 Download (46.34 MB)
Pop Up Box

Discover Your User Locations

Retrieve geolocation data for FREE now!