wampserver多站点多目录详细配置

王朝干货·作者佚名  2016-09-20
窄屏简体版  字體: |||超大  

wampserver多站点 多个目录的配置。以安装wampserver 在f:/wamp 为例。

方法/步骤

1:在f:\wamp\bin\apache\apache2.2.21\conf目录下打开 httpd.conf 查找到

#include conf/extra/httpd-vhosts.conf 把前面的# 去掉并保存

2:在f:\wamp\bin\apache\apache2.2.21\conf\extra目录下打开httpd-vhosts.conf 添加

<virtualhost *:80> serveradmin webmaster@dummy-host2.example documentroot "f:/web/" servername abc <director"f:/web/"> optionindexefollowsymlinkallowoverride all order allow,denallow from all </directory></virtualhost><virtualhost *:80> serveradmin webmaster@dummy-host2.example documentroot "f:/wamp/www/" servername localhost <director"f:/wamp/www/"> optionindexefollowsymlinkallowoverride all order allow,denallow from all </directory></virtualhost>

这样你就有 设置了两个路径 f:/web/ 以及 f:/wamp/www/ (这个原本是默认根目录) 也要添加过去 要不默认的根目录就会访问不到了。

3:在c:\windows\system32\drivers\etc 目录下打开hosts这个文件 添加

127.0.0.1 localhost

127.0.0.1 abc

这两行过去

4:重启wampserver 就能访问 abc 以及localhost 这两个站点了

注意事项

默认的根目录也要添加到httpd-vhosts.conf 不然默认路径就用不了了。

希望本文wampserver多站点多目录详细配置能帮到你。

小贴士:① 若网友所发内容与教科书相悖,请以教科书为准;② 若网友所发内容与科学常识、官方权威机构相悖,请以后者为准;③ 若网友所发内容不正确或者违背公序良俗,右下举报/纠错。
 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航