wamp自定义网站根目录

来源:互联网 发布:用友进销存软件价格 编辑:程序博客网 时间:2024/05/18 09:40

Apache配置文件在  D:\wamp\bin\apache\apache2.4.9conf\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 "D:/wamp/www/"

这块是Apache要执行的文件,可以修改到自己指定的目录下。

比如,我要修改成:

DocumentRoot "D:/demo/"


再找下面代码块

<Directory "D:/wamp/www/">

#code

</Directory>

如果修改了DocumentRoot后面的路径,相应的要把<Directory "D:/wamp/www/">路径改成一致的。

<Directory "D:/demo/">

#code

</Directory>

重启。


修改后,wamp控制面板www根目录还没有指向我们自己指定的根目录。所以我们要修改wamp配置文件。

打开D:\wamp\wampmanager.ini

再找下面代码块:

[Menu.Left]
……

……
Type: item; Caption: "phpMyAdmin"; Action: run; FileName: "C:\Windows\explorer.exe"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 5
Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "D:/wamp/www"; Glyph: 2
Type: submenu; Caption: "Apache"; SubMenu: apacheMenu; Glyph: 3

…………

把红色区域改成:

Type: item; Caption: "demo 目录"; Action: shellexecute; FileName: "D:/demo"; Glyph: 2

再打开D:\wamp\wampmanager.tpl

再找下面代码块:

[Menu.Left]
…………
Type: item; Caption: "${w_phpmyadmin}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 5
Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}"; Glyph: 2
Type: submenu; Caption: "Apache"; SubMenu: apacheMenu; Glyph: 3
……

把红色区域改成:

Type: item; Caption: "demo 目录"; Action: shellexecute; FileName: "D:/demo"; Glyph: 2

重启wamp。搞定!





0 0
原创粉丝点击