2014-02-26 32 views
0

我已经在GateIn 3.6中创建了一个门户并部署在服务器上,并且我在域名末尾添加了portal/boxmanagement来访问此门户,如http://www.example.com:8080/portal/boxmanagement。其实我想创建像在JBoss GateIn上的域名映射3.6通过虚拟主机的门户

http://www.example.com:8080/portal/portal1

http://www.example.com:8080/portal/portal2

同一服务器上的多个门户网站,我想将它们映射像

http://www.portal1.com指向http://www.example.com:8080/portal/portal1

http://www.portal2.com指向http://www.example.com:8080/portal/portal2

任何人都可以指导我如何使用JBoss 7.1在GateIn 3.6中实现此功能?预先感谢您在这方面的合作。

回答

0

我建议你使用Apache这样的前端Web服务器,在其上添加上述配置,将所有查询重定向到所需的域名。当然,你必须用正确的域名来代替服务器名和serverAlias

请尝试上面的配置

<VirtualHost *:80> 
    ProxyPreserveHost On 
    ProxyRequests Off 
    ServerName www.portal1.com 
    ServerAlias portal1.com 
    ProxyPass/http://localhost:8080/portal/portal1/ 
    ProxyPassReverse/http://localhost:8080/portal/portal1/ 
</VirtualHost> 

<VirtualHost *:80> 
    ProxyPreserveHost On 
    ProxyRequests Off 
    ServerName www.portal2.com 
    ServerAlias portal2.com 
    ProxyPass/http://localhost:8080/portal/portal2/ 
    ProxyPassReverse/http://localhost:8080/portal/portal2/ 
</VirtualHost> 

请注意,你需要保持斜杠“/”的URI的到底ProxyPass和ProxyPassReverse