gpt4 book ai didi

apache - 在 Ubuntu 12.04/14.04 LTS 上的 Apache 设置中是否默认忽略 .htaccess 文件?

转载 作者:行者123 更新时间:2023-12-04 18:41:33 25 4
gpt4 key购买 nike

当设置尽可能最小的 Apache 安装时(这在大多数教程中似乎是标准的)像这样......

(在裸机 Ubuntu 12.04/14.04 LTS 上)

sudo apt-get install apache2
sudo service apache2 restart

...然后 .htaccess文件(即使它们只有一个简单的 deny from all 内部)被完全忽略(因为 vhost 默认配置在 12.04 内有一个 AllowOverride None 相应地在 14.04 内没有)。

问题

这绝对是 Ubuntu 12.04/14.04 LTS 上 Apache2 的标准,还是我只是使用奇怪的服务器提供商?

最佳答案

是的,这是 Apache 在 14.04 LTS 中的默认配置。
我的 /etc/apache2.conf默认情况下有这个:

...
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
...
/etc/apache2/sites-available/000-default.conf有这个
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to...{removed lengthy text}
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels..{removed lengthy text}
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at...{removed lengthy text}
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

关于apache - 在 Ubuntu 12.04/14.04 LTS 上的 Apache 设置中是否默认忽略 .htaccess 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26343142/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com