Web Server
Apache HTTP Server Blocklist Tutorial
Block VPN, proxy and Tor traffic in Apache using mod_authz_host and mod_access_compat with IP lists loaded from CSV or TXT blocklist files.
Steps
- 1
Download the blocklist
Fetch the IP blocklist TXT file from your AntiProxies dashboard. This file contains one IP address or CIDR range per line.
- 2
Parse the file to Apache directives
Use a small shell script to convert the raw IP list into Apache Require not ip directives and write them to an include file.
- 3
Include the blocklist in your VirtualHost
Use the Include or IncludeOptional directive inside your VirtualHost block to load the generated deny rules.
- 4
Test and reload Apache
Run apachectl configtest to validate the configuration, then apachectl graceful to apply changes without dropping connections.
Need the blocklist files?
The annual license includes every format and monthly data releases.
Get the complete lists Inspect sample dataVirtualHost – include blocklist
Load the generated IP blocklist include file inside your VirtualHost.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/html
<Directory /var/www/html>
# Include AntiProxies IP blocklist
IncludeOptional /etc/apache2/blocklists/antiproxies.conf
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost> Generated blocklist include
Each blocked IP becomes a "Require not ip" line. Build this file from the downloaded TXT blocklist.
<RequireAll>
Require all granted
Require not ip 1.2.3.4
Require not ip 5.6.7.0/24
Require not ip 10.0.0.1
Require not ip 192.168.100.0/22
</RequireAll> Frequently asked questions
Which Apache module handles IP blocking?
Will a large blocklist slow down Apache?
Can I use this in .htaccess?
How do I get the real IP behind a reverse proxy?
Put the full dataset in your stack
€99/year gets you all 22 data categories, unlimited local queries, and one year of updates. Load the files once, keep your decision logic in-house, and update on your own deployment schedule.