本文介绍了更改 WAMP 中的根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望更改根目录以将目录指向以下位置:

I'm looking to change the root directory to point the directory to the following location:

C:\Documents and Settings\User\My Documents[documents]\wamp

C:\Documents and Settings\User\My Documents[documents]\wamp

我知道我必须在以下几行中更改 apache http.conf 文件

I know that I have to change the apache http.conf file in the following lines

DocumentRoot "c:/Documents and Settings/User/My Documents/[documents]/"

DocumentRoot "c:/Documents and Settings/User/My Documents/[documents]/"

然而,似乎除了[documents]之外的方括号导致显示禁止错误:

However, it seems that the square brackets besides [documents] are causing the Forbidden Error to be displayed:

禁止

您无权访问此服务器上的/login/.

You don't have permission to access /login/ on this server.

有没有办法在目录树中使用方括号?[documents] 是为特定目的而命名的,它需要保持这种状态.否则,我将需要进行大量重新编码.

Is there any way to use square brackets in the directory tree? [documents] is named for a particular purpose, and it needs to stay that way. Otherwise, I will need to do alot of recoding.

指向目录树的规则是什么?

What are the rules if any when pointing to a directory tree?

提前致谢.

推荐答案

我得到了同样的禁止错误(在 wamp 的 windows 机器中),经过大量的 r &d 我发现需要更改 httpd-vhosts.conf 文件中的默认虚拟主机,该文件位于:

I was getting same forbidden error (In windows machine for wamp), after lot of r & d I found that there is need to change default virtual host in httpd-vhosts.conf file which is present in:

C:\wamp\bin\apache\Apache2.2.17\conf\extra

(将目录 c:/wamp/www 更改为您想要的目录)

(change directory c:/wamp/www to what you want)

来自:

ServerAdmin webmaster@localhost
DocumentRoot "c:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common

致:

ServerAdmin webmaster@localhost
DocumentRoot "E:/wamp/www"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common

这篇关于更改 WAMP 中的根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:31