<VirtualHost *:80>

ServerAdmin webmaster@localhost

        ServerName ip-whitelist-test.thongquach.com

        ServerAlias http://www.ip-whitelist-test.thongquach.com

DocumentRoot /var/www/ip-whitelist-test

<Directory />

Options FollowSymLinks

AllowOverride None


<Directory /var/www/ip-whitelist-test/>

Options -Indexes +FollowSymLinks -MultiViews

AllowOverride All

                Require all granted


ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

LogLevel debug rewrite:trace3

CustomLog /var/log/apache2/access.log combined


<IfModule mod_rewrite.c>

RewriteEngine On

RewriteMap ipslist “txt:/var/www/ip-whitelist-test/whitelist.txt”

RewriteCond %{REMOTE_ADDR} ^(.*)$

RewriteCond ${ipslist:%1|black} ^black$ [NC]

RewriteRule (.*) – [F]

# RewriteCond %{REMOTE_ADDR} “!^${ipslist:%1|black}” [NC]

# RewriteCond %{REMOTE_ADDR} “!^” [NC]

# RewriteRule ^(.*)$ – [F,L]




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s