sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo a2enmod proxy_html
白名单,仅允许192.168.0.1以及192.168.1.1-192.168.1.255访问
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
#以下为关键代码
Order Deny,Allow
Allow from 192.168.0.1
Allow from 192.168.1.0/24
Deny from All
</Directory>
黑名单,禁止192.168.0.1以及192.168.1.1-192.168.1.255访问
<Directory "D:/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
#以下为关键代码
order allow,deny
allow from all
deny from 192.168.0.1
deny from 192.168.1.
</Directory>
注:192.168.1.0/24与192.168.1. 等价,仅为不同书写格式。