Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 如何从授权中排除某些IP_Apache_Apache2 - Fatal编程技术网

Apache 如何从授权中排除某些IP

Apache 如何从授权中排除某些IP,apache,apache2,Apache,Apache2,我有以下规则: <Location /> AuthType Basic AuthName test-server Require valid-user AuthUserFile /etc/apache2/passwd </Location> AuthType Basic AuthName测试服务器 需要有效用户 AuthUserFile/etc/apache2/passwd 但希望从授权过程中排除某些IP地址,因此,如果您是从此类地址

我有以下规则:

<Location />
    AuthType Basic
    AuthName test-server
    Require valid-user
    AuthUserFile /etc/apache2/passwd
</Location>

AuthType Basic
AuthName测试服务器
需要有效用户
AuthUserFile/etc/apache2/passwd
但希望从授权过程中排除某些IP地址,因此,如果您是从此类地址连接的,则不必提交登录名/密码。怎么做?


<Location />
    AuthType Basic
    AuthName test-server
    Require valid-user
    AuthUserFile /etc/apache2/passwd
    Deny from all
    Allow from 123.123.123.123
    Satisfy any
</Location>
AuthType Basic AuthName测试服务器 需要有效用户 AuthUserFile/etc/apache2/passwd 全盘否定 允许从123.123.123.123开始 满足任何
您还可以使用网络掩码来允许子网络。例如:“Allow from 192.168.100.0/24”将允许192.168.100.1到192.168.100.254之间的所有IP如何允许网站名称@可随机复制的