我正在尝试修改 Apache 中虚拟主机的 DocumentRoot。虚拟主机的 DocumentRoot 设置被忽略,而是使用整个 DocumentRoot。
就我而言,Apache 没有使用 /Applications/AMPPS/www/public 作为根文件夹,而是使用 /Applications/AMPPS/www。
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>