这是/etc/apache2/sites-enabled/000-default从存储库安装 apache2 后的文件。
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
第一部分设置了什么?对我来说,这看起来 DocumentRoot 应该是 / 而不是 /var/www 允许该<Directory />部分产生任何影响,但我必须是错误的。