• Your shopping cart is empty!

IP2Proxy Apache Module

The module detects visitor IP addresses which are used as VPN anonymizer, open proxies, web proxies and Tor exits.

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 IPv4 + IPv6
IP2Proxy PX1 Sample BIN File Download (14.37 MB)
IP2Proxy PX2 Sample BIN File Download (16.19 MB)
IP2Proxy PX3 Sample BIN File Download (20.54 MB)
IP2Proxy PX4 Sample BIN File Download (27.30 MB)
IP2Proxy PX5 Sample BIN File Download (29.24 MB)
IP2Proxy PX6 Sample BIN File Download (29.91 MB)
IP2Proxy PX7 Sample BIN File Download (32.20 MB)
IP2Proxy PX8 Sample BIN File Download (32.81 MB)