1
votes

I have created a portal in GateIn 3.6 and deployed on server and i have append portal/boxmanagement at the end of domain name to access this portal like http://www.example.com:8080/portal/boxmanagement. Actually I want to create multiple portals on same server like

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

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

and i want to map them like

http://www.portal1.com which points to http://www.example.com:8080/portal/portal1

http://www.portal2.com which points to http://www.example.com:8080/portal/portal2

Can anyone guide how i can achieve this functionality in GateIn 3.6 with JBoss 7.1? Thanks in advance for your cooperation in this regard.

1

1 Answers

1
votes

I would suggest that you use a frontal web server like Apache, on which you add the above configuration that will redirect all the queries to the desired domain name. Of course, you have to replace serverName and serverAlias with the right domain names

Please try the above configuration

<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> 

Please note that you need to keep the slashes "/" at the end of the URIs in ProxyPass and ProxyPassReverse