【发布时间】:2018-07-23 20:00:42
【问题描述】:
我了解DocumentRoot 指的是服务器的本地路径(在磁盘上),即与
<VirtualHost :80>
ServerName example.com
DocumentRoot /home/www/mysite1/
浏览http://example.com/foo/index.html 将访问服务器上的/home/www/mysite1/foo/index.html。
那么,我应该使用(有时似乎可行):
<Directory "/">
Require all granted
</Directory>
(引用/,即服务器文件系统的根目录是不是很奇怪?)
或者我应该像这样将DocumentRoot 复制/粘贴到Directory 中:
DocumentRoot /home/www/mysite1/
<Directory "/home/www/mysite1/">
Require all granted
</Directory>
?
如果是这样,每次修改DocumentRoot 时都必须复制/粘贴到Directory,这很烦人,为什么需要这种重复 配置路径?有没有办法说Require all grantedfor all而不必复制路径?
【问题讨论】: