apache virtualhostWindows不会更改DocumentRoot

问题描述

在Apache(Windows 10)上设置vHost时,一切正常-而不是DocumentRoot。 仍然是htdocs目录,而不是我在httpd-vhosts.conf中设置的目录:

not in

我还将域添加到位于C:\ Windows \ System32 \ drivers \ etc>的hosts文件夹中。这样该部分就可以正常工作:

Listen 80
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:\Test"
    ServerName www.test.test
    <Directory "C:\Test">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

就像在更改httpd.conf文件中的documentRoot时一样:

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost
    127.0.0.1       www.test.test

它似乎有效。但这不是一个正确的解决方案...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)