wamp多端口多域名虚拟机配置

一,httpd.conf修改监听端口,比如8090

Listen 0.0.0.0:8090
Listen [::0]:8090

二,httpd.conf 中,去掉
Include conf/extra/httpd-vhosts.conf
前面的注释.
三,修改D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
,注意,不同版本,可能所在目录不同.注意查找
在里面增加或修改.类似,表示这样访问时,http://127.0.0.1:8090/index2.html,会定位到d:/wamp/www/dux/egret/index2.html
同时,解析了一个ip地址为127.0.0.18的www.viq.com的本地子域名,访问时,会自动定位到D:/wamp/www/viq目录中,默认是80端口的.

<VirtualHost *:8090> 
	DocumentRoot "d:/wamp/www/dux/egret"
	ServerName 127.0.0.1
	ServerAlias localhost
</VirtualHost>

<VirtualHost *:80> 
	ServerAdmin webmaster@dummy-host.localhost 
	DocumentRoot "D:/wamp/www" 
	ServerName localhost
	ServerAlias localhost
	ErrorLog "logs/dummy-host.localhost-error.log" 
	CustomLog "logs/dummy-host.localhost-access.log" common 
	<Directory "D:/wamp/www"> 
		Options Indexes FollowSymLinks 
		AllowOverride None 
		Order allow,deny 
		Allow from all 
	</Directory> 
</VirtualHost> 



	
	<VirtualHost 127.0.0.18> 
	ServerAdmin webmaster@dummy-host.localhost 
	DocumentRoot "D:/wamp/www/viq" 
	ServerName www.viq.com
	ServerAlias localhost
	ErrorLog "logs/dummy-host.localhost-error.log" 
	CustomLog "logs/dummy-host.localhost-access.log" common 
	<Directory "D:/wamp/www/viq"> 
		Options Indexes FollowSymLinks 
		AllowOverride None 
		Order allow,deny 
		Allow from all 
	</Directory> 
</VirtualHost> 
	

四,如果开启了上面所说的www.viq.com子域名,则需要修改windows系统的C:\Windows\System32\drivers\etc\hosts文件.
增加

127.0.0.18   www.viq.com
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值