Foros de discusión

Adding virtual host for multiple instance

nidheesh ks, modificado hace 12 años.

Adding virtual host for multiple instance

New Member Mensajes: 23 Fecha de incorporación: 26/07/11 Mensajes recientes
Hi,

I have created 6 instances in liferay with different virtual host during development.
But for real deployment i have only 5 domain name and the one instance should be accessible as http://some-domain/some-name
Is it possible to map an instance to be accessible like this?
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
I dont know how much this is possible.. but you can give it a try..
Create a dummy virtual host name in hosts file. Give it to last instance. Now map this instance using apache proxy to the url you want.. emoticon
nidheesh ks, modificado hace 12 años.

RE: Adding virtual host for multiple instance

New Member Mensajes: 23 Fecha de incorporación: 26/07/11 Mensajes recientes
Thanks for you reply.
Iam using glassfish server , dont know whether it is possible to use proxy like what we use in apache.
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
I believe there should not be any issue with the app server here. Since any outside user will send a request to suppose url1 which is mapped to url2 by apache proxy. Apache will proxy all requests accordingly.. it will take request as url1 and will request url2 on the system.. whatever is the response, it will send as url1 to the user.

No where the app server is in picture.. Try this and see if it works fine..
nidheesh ks, modificado hace 12 años.

RE: Adding virtual host for multiple instance

New Member Mensajes: 23 Fecha de incorporación: 26/07/11 Mensajes recientes
In my case Glassfish is the Application server (Glassfish 3.0). We are not using apache as the application server.
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
Apache is not an application server.. thats a simple web server which you need to put in front of your application server as a proxy to all sites.. emoticon
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
Please note that this is just one possible solution.. if there is any other way, I am not aware of that emoticon
thumbnail
Milen Dyankov, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Regular Member Mensajes: 171 Fecha de incorporación: 23/09/09 Mensajes recientes
Ravi Kumar Gupta:
I believe there should not be any issue with the app server here. Since any outside user will send a request to suppose url1 which is mapped to url2 by apache proxy. Apache will proxy all requests accordingly.. it will take request as url1 and will request url2 on the system.. whatever is the response, it will send as url1 to the user.


In fact this will not always work as sometimes Liferay generates URLs based on virtual host's name. So if you do as described above, you may end up viewing page at http://host1/page in which some links will be /page2 but some will be http://host2/page3. Needles to say the second one will not work unless host2 is accessible to the client.

Of course you may configure some-domain as default domian and then acces the other one via http://some-domain/web/some-name/... but I guess this is not what you want.
thumbnail
Ravi Kumar Gupta, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
Fair point Milen.. emoticon

Can this not be solved using a different context than Root.. ???
nidheesh ks, modificado hace 12 años.

RE: Adding virtual host for multiple instance

New Member Mensajes: 23 Fecha de incorporación: 26/07/11 Mensajes recientes
I will elaborate more clearly what is my issue :-
Suppose I have 3 instance in liferay other than the default one.
instance 1 - a.com
instance 2 - b.com
instance 3 - c.com

But now at the time of deployment, i have only two domain names a.com and b.com
And the other one should be accessible as "a.com/c"
All pages in third website should comes as a.com/c/*

Iam not getting any idea, if nothing is happening I will have to create all the pages inside a.com with "/c/*" as friendly url.

Another idea i thought is about creating another organization with name "c" in a.com, but doing this also /web/c/ will be coming .
Is there any other solution
thumbnail
Arno Broekhof, modificado hace 12 años.

RE: Adding virtual host for multiple instance

Junior Member Mensajes: 42 Fecha de incorporación: 18/10/11 Mensajes recientes
You can try accomplishing this with you're reverse proxy by doing something like the following ( if you're using apache )

for the website where you wish to use /a create set a virtual example.com in the portal instance and make sure you're reverse proxy server can
resolve the example.com server.

NameVirtualHost 23.123.123.123:80
<VirtualHost 123.123.123.123:80>
ServerName www.a.com

ProxyPreserveHost Off
ProxyTimeOut 30
ProxyVia Off
<Location /a >
ProxyPass http://example.com:8080/
</Location>

</VirtualHost>
nidheesh ks, modificado hace 12 años.

RE: Adding virtual host for multiple instance

New Member Mensajes: 23 Fecha de incorporación: 26/07/11 Mensajes recientes
Thank you for your reply , but we are not using apache. We don't have much time , so we have started creating pages inside first site itself.