为安全配置 apache2
configuring apache2 for security
参考本文档 https://httpd.apache.org/docs/2.4/howto/access.html and https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html#requiredirectives ,指令应插入哪个文件?例如'Require ip 127.0.0.1'
我说的是 debian 中 apache2 的配置,我想限制除 127.0.0.1 以外的所有本地主机的访问权限。
谢谢
您可以在 VirtualHost 的配置文件中设置您想要授予访问权限的 IP(默认设置在 /etc/apache2/sites-avaiable/000-default.conf)
好的,我解决了。进入配置的正确文件是/etc/apache2/apache2.conf
这是配置:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
# Require all granted
Require host localhost
# Require all denied
</Directory>
参考本文档 https://httpd.apache.org/docs/2.4/howto/access.html and https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html#requiredirectives ,指令应插入哪个文件?例如'Require ip 127.0.0.1' 我说的是 debian 中 apache2 的配置,我想限制除 127.0.0.1 以外的所有本地主机的访问权限。 谢谢
您可以在 VirtualHost 的配置文件中设置您想要授予访问权限的 IP(默认设置在 /etc/apache2/sites-avaiable/000-default.conf)
好的,我解决了。进入配置的正确文件是/etc/apache2/apache2.conf 这是配置:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
# Require all granted
Require host localhost
# Require all denied
</Directory>