<VirtualHost _default_:80> DocumentRoot "D:\phpStudy\test" <Directory "D:\phpStudy\test"> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Require all granted Require not ip 192.168.1.10 </Directory> </VirtualHost>这样就错了
记得配合orderOrder Deny,Allow Deny from 192.168.1.10 Allow from all
<VirtualHost _default_:80> DocumentRoot "D:\phpStudy\test" <Directory "D:\phpStudy\test"> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Require all granted Deny from 192.168.1.10 </Directory> </VirtualHost>这样启动是能启动的,就是没有效果,网站照样能打开
<VirtualHost _default_:80> DocumentRoot "D:\phpStudy\test" <Directory "D:\phpStudy\test"> Options +Indexes +FollowSymLinks +ExecCGI Order Allow,Deny Allow from all Deny from 192.168.1.10 Deny from 127.0.0.1 #Require all granted </Directory> </VirtualHost>我改成这样的,没有用,本机的IP是什么呢
Order Allow,Deny 顺序换一下试试 Order Deny,Allow
AllowOverride All <RequireAll> Require all granted #Require all denied Require not ip 115.171.178.29 Require not local </RequireAll>Require not local 这句在本地倒是能屏蔽掉,在服务器上改成IP后就没有什么用 Require not ip 115.171.178.29
Deny from 192.168.1.10
DocumentRoot "D:\phpStudy\test"
<Directory "D:\phpStudy\test">
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
Require not ip 192.168.1.10
</Directory>
</VirtualHost>这样就错了
记得配合orderOrder Deny,Allow
Deny from 192.168.1.10
Allow from all
DocumentRoot "D:\phpStudy\test"
<Directory "D:\phpStudy\test">
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
Deny from 192.168.1.10
</Directory>
</VirtualHost>这样启动是能启动的,就是没有效果,网站照样能打开
DocumentRoot "D:\phpStudy\test"
<Directory "D:\phpStudy\test">
Options +Indexes +FollowSymLinks +ExecCGI
Order Allow,Deny
Allow from all
Deny from 192.168.1.10
Deny from 127.0.0.1
#Require all granted
</Directory>
</VirtualHost>我改成这样的,没有用,本机的IP是什么呢
<RequireAll>
Require all granted
#Require all denied
Require not ip 115.171.178.29
Require not local
</RequireAll>Require not local 这句在本地倒是能屏蔽掉,在服务器上改成IP后就没有什么用 Require not ip 115.171.178.29