dti3914
2016-09-13 23:17
浏览 46
已采纳

Wamp文档根目录未更新

Just finished installing WampServer 3.0.4. I want to set it up so when I visit http://localhost/, it serves the files within e:/Archives/, instead of the default WampServer page.

Approach

I found many answers that say I have to open c:/wamp/bin/apache/apache2.4.18/conf/httpd.conf and look for both the DocumentRoot and Directory lines (I found them around line 250). I substituted this:

DocumentRoot "c:/wamp/www"
<Directory "c:/wamp/www/">
    #...
    Options +Indexes +FollowSymLinks
    #...
    AllowOverride all
    #   onlineoffline tag - don't remove
    Require local
</Directory>

with this:

DocumentRoot "e:/Archives/"
<Directory "e:/Archives/">
    #...
    Options +Indexes +FollowSymLinks
    #...
    AllowOverride all
    #   onlineoffline tag - don't remove
    Require local
</Directory>

Notice the only two things updated were the Document Root and Directory paths.

My problem

Now, when I point my browser to http://localhost, it still shows the same default WampServer page in C:\wamp\www\index.php. Clicking on the phpinfo() link shows the following:

DOCUMENT_ROOT  C:/wamp/www
CONTEXT_DOCUMENT_ROOT C:/wamp/www 

... which leads me to believe that my changes to httpd.conf aren't making any difference.

Has anybody ran into this issue? Is there a different way to change the default location that localhost points to? I've tried restarting WampServer, restarting my computer (Running Windows 7), etc.

图片转代码服务由CSDN问答提供 功能建议

刚刚安装完WampServer 3.0.4。 我想设置它,所以当我访问 http:// localhost / 时,它会提供 e:/中的文件 Archives / ,而不是默认的WampServer页面。

方法

我发现很多答案都说 我必须打开 c:/wamp/bin/apache/apache2.4.18/conf/httpd.conf 并查找DocumentRoot和Directory行(我在第250行找到它们)。 我替换了这个:

  DocumentRoot“c:/ wamp / www”
&lt; Directory“c:/ wamp / www /”&gt; 
#... 
 选项+索引+ FollowSymLinks 
#... 
 
NandOverride all 
 #onlineoffline标记 - 不要删除
需要本地
&lt; /目录&gt; 
   
 
 <  p> with this: 
 
 
  DocumentRoot“e:/ Archives /”
&lt; Directory“e:/ Archives /”&gt; 
#... 
选项+ 索引+ FollowSymLinks 
#... 
 
NandOverride all 
 #onlineoffline标记 - 请勿删除
需要本地
&lt; /目录&gt; 
   
 
 

请注意,更新的唯一两件事是文档根目录和目录路径。

我的问题

现在,当我指出 我的浏览器 http:// localhost 仍然 C:\ wamp \ www \ index.php 中显示相同的默认WampServer页面。 单击 phpinfo()链接显示以下内容:

  DOCUMENT_ROOT C:/ wamp / www 
CONTEXT_DOCUMENT_ROOT C:/ wamp / www 
 <  / code>  
 
 

...这让我相信我对httpd.conf的更改没有任何区别。

有没有人跑过 进入这个问题? 有没有不同的方法来更改 localhost 指向的默认位置? 我尝试重新启动WampServer,重新启动计算机(运行Windows 7)等。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题