Fórum

Virtual host administration

thumbnail
Zsolt Balogh, modificado 14 Anos atrás.

Virtual host administration

Expert Postagens: 463 Data de Entrada: 23/03/09 Postagens Recentes
Hi,

To learn Liferay's internal architecture, I've started a project on my free time. My idea was that I should try to make virtual hosting easier in liferay.

My solution is about to get ready, tests show that the design I planned is not so bad, so I think it could be merged into 5.3 if you find it right.

There are three basic problems with the current method of Liferay virtual hosting:
  • You can't create aliases or redirects. Redirects are working by installing a web fronted for them, but aliases are working only with hacks
  • If you use multiple virtual hosts, the instance virtual host is getting annoying, you can't add that name to one of the communities, and that's not good
  • There's no list of virtual hosts for administrators, it's hard to check all of them if you have a lot of communities


My solution is:
I've created a new portal type in Liferay called VirtualHost. Three types of virtual hosts can be created: basic, alias, redirect.

The basic virtual host can be any type which has LayoutSet (actually: communities, orgs, users). The alias is an alias to a Virtual Host (if you have a virtual host named a.example.com and you want the same content on b.example.com, you just need to add a new alias). The redirects are like simple redirects to another virtual hosts, or url, so you can create a virtual host pointing to another virtual host or a page of it (e.g. example.com -> www.example.com, or something.com -> example.com/something).

The project is almost ready, it's working nicely with trunk now. If it won't be just my experimental project, I'll need to work some time on permissions, as no checks are done yet.

What do you think? Are you planning any feature like this in 5.3?
thumbnail
Wilson Man, modificado 14 Anos atrás.

RE: Virtual host administration

Liferay Master Postagens: 581 Data de Entrada: 21/06/06 Postagens Recentes
very interesting!!! +1 from me!
thumbnail
Ray Augé, modificado 14 Anos atrás.

RE: Virtual host administration

Liferay Legend Postagens: 1197 Data de Entrada: 08/02/05 Postagens Recentes
We've had several attempts at this feature, but have never come up with one that was acceptable.

You're approach is quite different and looks very promising since it touches very little of the existing architecture and appears to only be a narrow tier above it.

I like it, very nice!
thumbnail
Jorge Ferrer, modificado 14 Anos atrás.

RE: Virtual host administration

Liferay Legend Postagens: 2871 Data de Entrada: 31/08/06 Postagens Recentes
Hi Zsolt,

Would this be a complete replacement of our current way of asigning Virtual Hosts to communities, organizations or instances? or would it be a complement?

If it's the former, how would you handle the migration?
thumbnail
Zsolt Balogh, modificado 14 Anos atrás.

RE: Virtual host administration

Expert Postagens: 463 Data de Entrada: 23/03/09 Postagens Recentes
Hi Jorge,

It's the former and the upgrade process could create new virtual hosts from the layoutsets' virtual hosts. (Not ready yet)

I was thinking about it a lot and it seems to be the best solution.

I was wondering, what backward compatiblity is needed:
  • database level: we should store the virtual host in the layouset table too as "old" times. This is data duplication and I really don't like it
  • rewrite the LayoutSet services so the API woudn't be changed, external applications will work after upgrade without modifications
  • remove the old services to reach layoutsets by virtual hosts


I personally would prefer the 2nd one, but I don't know what's the rule for this in Liferay.
thumbnail
Kyrre Myrbostad, modificado 14 Anos atrás.

RE: Virtual host administration

Junior Member Postagens: 37 Data de Entrada: 21/01/09 Postagens Recentes
This looks very promising! We are struggling with virtual hosts right now.

Our user case is this: We have an external site which is modelled after our organisational structure, and we want to use organisations in liferay as it gives us a natural scope for cms content, publishing roles etc. But we still want the whole organisation to appear as under one single domain and with greater control over the URLs (we don't want any "/web" f.ex.). We are looking at doing this with some apache proxy hacks, but we are not too happy with the solutions we have found so far.

Your approach to virtual hosting seems much more powerful and flexible, if I have understood it right.

Is there any chance that this could find it's way into 5.3EE before may? And is there perhaps something we could do to help speed the process?
thumbnail
Zsolt Balogh, modificado 14 Anos atrás.

RE: Virtual host administration

Expert Postagens: 463 Data de Entrada: 23/03/09 Postagens Recentes
Kyrre Myrbostad:
Our user case is this: We have an external site which is modelled after our organisational structure, and we want to use organisations in liferay as it gives us a natural scope for cms content, publishing roles etc. But we still want the whole organisation to appear as under one single domain and with greater control over the URLs (we don't want any "/web" f.ex.). We are looking at doing this with some apache proxy hacks, but we are not too happy with the solutions we have found so far.

Your approach to virtual hosting seems much more powerful and flexible, if I have understood it right.


If I understand your problem, you want more organizations to share the same url namespace. My implementation won't support this, as it tries to be small and effective. You can assign multiple virtual hosts to a organization but you can't assign one community to more organizations.

Do you want to seperate your sub-orgs by path(e.g. example.com/hr/..., example.com/it/... ?)

Kyrre Myrbostad:
Is there any chance that this could find it's way into 5.3EE before may?

I try to be ready with the patch soon and the guys from Liferay will decide if they want this or not.

Kyrre Myrbostad:
And is there perhaps something we could do to help speed the process?

I've got support from my company, so if I'll have time to cleanup my actual version, it should be ready soon. emoticon
thumbnail
Kyrre Myrbostad, modificado 14 Anos atrás.

RE: Virtual host administration

Junior Member Postagens: 37 Data de Entrada: 21/01/09 Postagens Recentes
Do you want to seperate your sub-orgs by path(e.g. example.com/hr/..., example.com/it/... ?)


Yes, that is exactly what we want. We also need to skip the hierarchy in some ways (e.g. if department is under faculty logically, we still want the url to be example.com/department and not example.com/faculty/department). The ones who made these policies are not IT-staff...

I guess we will have to make a proxy on the apache in front, and load that with some nasty rules, unless anyone know a clean way to do this in Liferay.

I've got support from my company, so if I'll have time to cleanup my actual version, it should be ready soon

Good news! Even if it won't solve our case, it's still a nice feature emoticon
Dennis Koch, modificado 14 Anos atrás.

RE: Virtual host administration

New Member Mensagem: 1 Data de Entrada: 17/12/09 Postagens Recentes
Hi Zsolt,

your patch looks really promising. Is it ready to use? Would you share it?

Best regards and keep up the good work, Dennis
thumbnail
Zsolt Balogh, modificado 14 Anos atrás.

RE: Virtual host administration

Expert Postagens: 463 Data de Entrada: 23/03/09 Postagens Recentes
I'm just waiting for this to be committed to svn, I need it for my patch (it's a helper for virtual host selection), I don't want to include it too in my patch(it'd became too large).

So, the patch is working I just have UI problems emoticon
thumbnail
Sampsa Sohlman, modificado 14 Anos atrás.

RE: Virtual host administration

Regular Member Postagens: 230 Data de Entrada: 27/09/07 Postagens Recentes
Any news on this feature. Will 6.0 have this?

- Sampsa
James McGovern, modificado 13 Anos atrás.

RE: Virtual host administration

Junior Member Postagens: 68 Data de Entrada: 13/06/10 Postagens Recentes
Should certain aliases be automatic? For example: saas.liferay.com vs www.saas.liferay.com?
James McGovern, modificado 13 Anos atrás.

RE: Virtual host administration

Junior Member Postagens: 68 Data de Entrada: 13/06/10 Postagens Recentes
VirtualHosts is one answer but I believe we are ignoring another fundamental problem. When is it ever a good idea to make a directory structure look like an organization structure?

If you have ever worked in an enterprise context, you will understand the need for free reorganizations where the organization structure is almost always guaranteed to change on at least an annual basis. If we could somehow decouple these two concerns, all would benefit.