2014-02-26 27 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