我一直在玩apache2中的http-vhost.conf
文件,以实现以下目标:
我有两个域名:
domain1.co.uk (app to be hosted by apache2 on port 80)
domain2.com (app to be hosted by glassfish on port 8080)
我已在两个域上配置DNS以指向同一位置。
这是我的http-vhost.conf
文件的内容:
NameVirtualHost *
<VirtualHost *>
ServerName www.domain2.com
ServerAlias domain2.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://domain2.com:8080/
ProxyPassReverse / http://domain2.com:8080/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/opt/lampp/htdocs/"
ServerName www.domain1.co.uk
ServerAlias domain1.co.uk
# ErrorLog "logs/dummy-host2.example.com-error_log"
# CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
问题在于,如果我将domain2.com
放入浏览器,则会显示domain1.co.uk
个应用。
请帮忙!