自己对域名什么的啊,以前从来没有接触过,也不是很了解,今天下午经过杨哥的一番讲解,总算理解的差不多啦,哈哈……
思路是用Apache作为代理进行跳转,所有的请求首先发送到Apache的80端口,由Apache判断servername,通过配置文件进行跳转。
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
ServerName trustauth.cn
ProxyPass / http://trustauth.cn:81/
ProxyPassReverse / http://trustauth.cn:81/
当用户从浏览器上输入http://trustauth.cn的时候会通过apache转送到http://trustauth.cn:81下,即IIS的默认页。
ServerName trustauth.cn/RFID
ProxyPass / http://trustauth.cn:81/RFID
ProxyPassReverse / http://trustauth.cn:81/RFID
其中RFID是在IIS建立的一个虚拟目录,当用户从浏览器上输入http://trustauth.cn/RFID的时候,会通过apache转送到http://trustauth.cn:81/RFID下。
ServerName trustauth.cn
ProxyPass / http://trustauth.cn:8080/
ProxyPassReverse / http://trustauth.cn:8080/
当用户从浏览器上输入trustauth.cn是,会通过Apache转送到tomcat上,启动tomcat的起始页,注意,这里的配置http://trustauth.cn:8080后面一定要加上“/”,否则会抛出异常,比如webapps下面有caizhengju,但是,如果不加/通过,trustauth.cn/caizhengju回报错”can
not find http://locahost:8080caizengju”