Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Tom Mahy
Liferay with Multiple Instances
5. Juni 2012 02:09
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

Hi,

I'm using liferay 6.0.6
I go into the control panel and add an instance.

identifier : test.com
vhost : test.com
mail : test.com

It created fine. I have then put an apache server with reverse proxy in front of it.
I browse to the original URL and see the site. But when i go to the site with the secondary address i still see the first instance.
The url is fine and is correct , but when i go into the control panel all options have links to the first instance.

What am i doing wrong ?
I have also tried adding the urls to the hosts file.

120.0.0.1 test.com
120.0.0.1 test1.com

But that doesnt change anything.
The only doc i could find was from liferay 4.3
http://content.liferay.com/4.3/doc/installation/liferay_4_installation_guide/multipage/ch06.html

Any help ?
Hitoshi Ozawa
RE: Liferay with Multiple Instances
11. Juni 2012 15:26
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

Your question is a little bit confusing. Are you trying to add "test.com" or "test1.com"?
What's your environment? Are you on linux + tomcat?

How are you setting up connection to your application server from Apache? Are you letting domain name through and not redirecting to your first domain name or ip address of the server?
Tom Mahy
RE: Liferay with Multiple Instances
12. Juni 2012 00:23
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

Hi,

Thanks for the feedback.
test.com is the default instance ( changed from liferay.com )
test1.com is the second instance.

We are using linux and tomcat from the default package.

For the apache we use the ip.
So the user connects to the apache with test.com or test1.com and this redirects to the same IP.
It this causing the problem ?
Milen Dyankov
RE: Liferay with Multiple Instances
12. Juni 2012 04:32
Antwort

Milen Dyankov

Rang: Regular Member

Nachrichten: 173

Eintrittsdatum: 23. September 2009

Neue Beiträge

If I correctly understand your situation, you have 2 virtual hosts on the Apache side and both of them proxy requests to the same Liferay instance by IP.

If that is so, then from Liferay's perspective in both cases the request goes to server's IP address (not domain name) and thus it will select the default instance.
In order to make that work you'll have to proxy to given domain name (not IP address) or use mod_jk/mod_proxy_ajp which will automatically pass the domain name to Liferay.
Tom Mahy
RE: Liferay with Multiple Instances
12. Juni 2012 03:37
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

I will try this asap.

But how would this work with a cluster setup ?
For our production environment we have the apache setup which redirects to a load balancer ( hardware ) and then to an array of liferay cluster nodes. Again this is currently done with the IP (on apache and the load balancer).

Does this mean we will need a load balancer per instance ? with the load balancers redirecting with the hostname ?
Milen Dyankov
RE: Liferay with Multiple Instances
12. Juni 2012 04:31
Antwort

Milen Dyankov

Rang: Regular Member

Nachrichten: 173

Eintrittsdatum: 23. September 2009

Neue Beiträge

Tom Mahy:
But how would this work with a cluster setup ?
For our production environment we have the apache setup which redirects to a load balancer ( hardware ) and then to an array of liferay cluster nodes. Again this is currently done with the IP (on apache and the load balancer).

Does this mean we will need a load balancer per instance ? with the load balancers redirecting with the hostname ?


Honestly speaking I've never used Liferay's virtual instances feature (apart from some out of curiosity experiments).
However I've done similar things with multiple sites/communities (having different virtual hosts) and mod_proxy_ajp on Apache side. It works without problems.
If you have to stick with HTTP proxy approach then I guess you'll have to load balancer per domain. Of course there may be a better way, which I'm not aware of.
Juan Gonzalez
RE: Liferay with Multiple Instances
12. Juni 2012 05:26
Antwort

Juan Gonzalez

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2798

Eintrittsdatum: 28. Oktober 2008

Neue Beiträge

Milen Dyankov:
If I correctly understand your situation, you have 2 virtual hosts on the Apache side and both of them proxy requests to the same Liferay instance by IP.

If that is so, then from Liferay's perspective in both cases the request goes to server's IP address (not domain name) and thus it will select the default instance.
In order to make that work you'll have to proxy to given domain name (not IP address) or use mod_jk/mod_proxy_ajp which will automatically pass the domain name to Liferay.


That's right. Load balancer should pass somehow client host header with original host name (instead of internal cluster server IP/name). It should be possible tweaking some Apache config.
Hitoshi Ozawa
RE: Liferay with Multiple Instances
12. Juni 2012 15:46
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

Also, be sure to use domain name to redirect in portal-ext.properties

##
## Redirect
##

#
# Set this property to "ip" or "domain" for the redirect security method. If
# set to "domain", the portal will only redirect users to domains listed in
# the property "redirect.url.domain.allowed". If set to "ip", the portal
# will only redirect to domains whose IP address resolve to an IP address
# listed in the property "redirect.url.ip.allowed".
#
#redirect.url.security.mode=domain
redirect.url.security.mode=ip

#
# Input a list of comma delimited domains which the portal is allowed to
# redirect to. Input a blank list to allow any domain.
#
redirect.url.domains.allowed=

#
# Input a list of comma delimited IPs which the portal is allowed to
# redirect to. Input a blank list to allow any IP. SERVER_IP will be
# replaced with the IP of the host server.
#
redirect.url.ips.allowed=127.0.0.1,SERVER_IP
Tom Mahy
RE: Liferay with Multiple Instances
25. Juni 2012 01:21
Antwort

Tom Mahy

Rang: Regular Member

Nachrichten: 103

Eintrittsdatum: 11. Mai 2011

Neue Beiträge

Thank you for the support. That worked.