我自己测试了下,把虚拟子目录移出wamp\www目录,比如在其他磁盘新建个目录存放子目录,这样问题好像解决了,但是还是不知道为什么。
环境:windows server 2003
软件:wamp 版本 2.4
目前状态:服务器正常,web外网可以访问(通过8081端口),通过ip和域名都可访问
需求:我有多个子域名,想做虚拟目录,比如wamp\www\test\ 对应域名test.abc.com
问题:现在打开test.abc.com:8081 直接是 www目录,显示的是网页版的文件夹目录
(备注:我用的是8081端口)
我的处理过程:1.百度 谷歌找了些教程,配置:apache conf,配置如下:打开了 virtualhost 的加载:
# virtual hostsinclude conf/extra/httpd-vhosts.conf
2.然后增加虚拟目录:
注释原来的
# #serveradmin webmaster@dummy-host.example.com #documentroot c:/apache24/docs/dummy-host.example.com #servername dummy-host.example.com #serveralias www.dummy-host.example.com #errorlog logs/dummy-host.example.com-error.log #customlog logs/dummy-host.example.com-access.log common## #serveradmin webmaster@dummy-host2.example.com #documentroot c:/apache24/docs/dummy-host2.example.com #servername dummy-host2.example.com #errorlog logs/dummy-host2.example.com-error.log #customlog logs/dummy-host2.example.com-access.log common#
增加新的虚拟目录
options indexes order allow,deny allow from all documentroot d:/wamp/www/test/ serverpath d:/wamp/www/test/ servername test.abc.info
结果打开还是:
大致情况就这样,希望大家帮我看看
这个问题已被关闭,原因:
回复内容: [2013-11-03修改]
我自己测试了下,把虚拟子目录移出wamp\www目录,比如在其他磁盘新建个目录存放子目录,这样问题好像解决了,但是还是不知道为什么。
环境:windows server 2003
软件:wamp 版本 2.4
目前状态:服务器正常,web外网可以访问(通过8081端口),通过ip和域名都可访问
需求:我有多个子域名,想做虚拟目录,比如wamp\www\test\ 对应域名test.abc.com
问题:现在打开test.abc.com:8081 直接是 www目录,显示的是网页版的文件夹目录
(备注:我用的是8081端口)
我的处理过程:1.百度 谷歌找了些教程,配置:apache conf,配置如下:打开了 virtualhost 的加载:
# virtual hostsinclude conf/extra/httpd-vhosts.conf
2.然后增加虚拟目录:
注释原来的
# #serveradmin webmaster@dummy-host.example.com #documentroot c:/apache24/docs/dummy-host.example.com #servername dummy-host.example.com #serveralias www.dummy-host.example.com #errorlog logs/dummy-host.example.com-error.log #customlog logs/dummy-host.example.com-access.log common## #serveradmin webmaster@dummy-host2.example.com #documentroot c:/apache24/docs/dummy-host2.example.com #servername dummy-host2.example.com #errorlog logs/dummy-host2.example.com-error.log #customlog logs/dummy-host2.example.com-access.log common#
增加新的虚拟目录
options indexes order allow,deny allow from all documentroot d:/wamp/www/test/ serverpath d:/wamp/www/test/ servername test.abc.info
结果打开还是:
大致情况就这样,希望大家帮我看看
这样..
#httpd.conf里的 default servernamevirtualhost *:80 servername localhost documentroot d:\wamp\www serveradmin yoo@gay.cninclude conf/vhost/*-vhost.conf
#这个是对应的 /vhost/project1-vhost.conf documentroot d:\wamp\www\project1 servername project1.com
#端口号不用改 serveradmin mail@domain.com #这里是你的网站管理员的邮箱,一般随便设置一个 documentroot c:/wamp/www/domain.com #这里是你的网站根目录 对应hosts文件中要添加对应的ip跟域名 servername domain.com #这里是你的域名
建议转用xampp,现在wamp发展的有点不太给力。
你的第一步是正确的,后面的其实在httpd-vhosts.conf这个文件里有示例的,你取消注释一个,改成自己的域名就可以了,hosts里面一定要添加你设置的域名。
