问题:
以下是我已经做的:
- 已编辑
/etc/httpd/conf.d/awesome-site.conf
我在上面放了2个白名单的IP
<VirtualHost *:80>
ServerName awesomesite.co.id
DocumentRoot /var/www/html/awesome
ErrorLog /var/log/httpd/awesome-site-error.log
CustomLog /var/log/httpd/awesome-site-requests.log combined
#commented for testing PHP proxy, allow both http and https work
RewriteEngine on
RewriteCond %{SERVER_NAME} =awesomesite.co.id
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<Directory /dev123/*>
Order deny,allow
Deny from all
Allow from 123.123.100.100
Allow from 200.200.44.59
</Directory>
- 重新启动Apache:
systemctl restart http.service
答案1:
从2.4版开始,不再使用mod_access_compat提供的Allow,Deny和Order指令,它将不再起作用。
使用Require
代替:
Require ip 123.123.100.100
Require ip 200.200.44.59
Require
指令由mod_authz_host
模块提供。
相关文章