我正在尝试修改Apache中虚拟主机的DocumentRoot。虚拟主机的DocumentRoot设置将被忽略,而是使用总体DocumentRoot。
在我的例子中,Apache使用/Applications/AMPPS/www/public作为根文件夹,而不是使用/Applications/AMPPS/www /public作为根文件夹。
httpd.conf文件的相关部分如下所示。有没有人看到问题了?
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Applications/AMPPS/www"
...snip...
<VirtualHost 127.0.0.1:80>
<Directory "/Applications/AMPPS/www">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName localhost
ServerAlias localhost 127.0.0.1
ScriptAlias /cgi-bin/ "/Applications/AMPPS/www/cgi-bin/"
DocumentRoot "/Applications/AMPPS/www/public"
ErrorLog "/Applications/AMPPS/apache/logs/error_log"
CustomLog "/Applications/AMPPS/apache/logs/access.log" combined
</VirtualHost>https://stackoverflow.com/questions/41326861
复制相似问题