参考文档https://httpd.apache.org/docs/2.4/howto/access.html和https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html#requiredirectives,指令应该插入到哪个文件中?例如:‘'Require 127.0.0.1’我说的是apache2在debian中的配置,我想限制所有人的访问权限,除了127.0.0.1,localhost。谢谢
发布于 2020-01-23 03:43:47
好了,我解决了。输入配置的正确文件是/etc/apache2/apache2.conf这是配置:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
# Require all granted
Require host localhost
# Require all denied
</Directory>
发布于 2020-01-23 02:43:39
您可以在VirtualHost的配置文件中设置想要授予访问权限的IP (默认在/etc/apache2/sites avaiable/000-default.conf上)
https://stackoverflow.com/questions/59866295
复制相似问题