【问题标题】:How to Set and Access Multiple Document Root(Directory) in Apache (Wamp Server)如何在 Apache(Wamp 服务器)中设置和访问多个文档根目录(目录)
【发布时间】:2014-05-10 04:26:32
【问题描述】:

我尝试添加;

 <VirtualHost *:80>
ServerName localhost 
DocumentRoot "d:\www2\" --> tried d:\www2\
<Directory "d:\www2\">
    Options Includes Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>
Directoryindex index.php index.html index.html index.htm index.shtml
AccessFileName .htaccess

对于 httpd-vhosts,我仍然只能访问 "c:/wamp/www" 。我想和他们两个一起访问。请帮帮我。

【问题讨论】:

  • 你想在这里实现什么?你只能有一个DocumentRoot,否则服务器怎么知道从哪个位置提供文件?

标签: php apache vhosts document-root


【解决方案1】:

每个 ServerName 只能有一个文档根目录。

尝试使用另一个服务器名称(如 localhost2)设置一个虚拟主机,然后修改您的hosts 文件以将 localhost2 指向您的本地 ip (127.0.0.1)

【讨论】:

  • 我试过 localhost2 工作正常,但我无法访问我想要的路径。只能访问“c:/wamp/www”。为什么?
  • 您能在此处发布您的 vhosts 文件吗?
猜你喜欢
  • 1970-01-01
  • 2020-02-14
  • 2014-10-04
  • 2014-07-26
  • 1970-01-01
  • 2012-03-07
  • 1970-01-01
  • 2011-08-14
  • 2021-12-19
相关资源
最近更新 更多