Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Martin Kofoed
Virtual Hosts in 5.2.x
23. Februar 2009 04:56
Antwort

Martin Kofoed

Rang: New Member

Nachrichten: 15

Eintrittsdatum: 23. Februar 2009

Neue Beiträge

I have two sites that are set up as virtual hosts using apache as front end. I'm using MOD_JK to link apache to the app server by having a "JkMount /* worker1" for each apache VirtualHost directive.

I was happy to see support for mapping individual community pages to its own public DNS entry, as this is exactly the behaviour I'm looking for.

So I set up two new communities, and assigned a public address for each. But when accessing any of the sites afterwards, I am redirected to the /web/guest URI instead of /web/mynewcommunity as expected. I also tried the same setup but using Organizations instead. Same result.

Have I completely misunderstood the concept of Liferay virtual hosts? Or do I just need some simple twist to have my hosts work as expected?

Any help or pointers would be appreciated! :-)
Jonas Yuan
RE: Virtual Hosts in 5.2.x
23. Februar 2009 07:59
Antwort

Jonas Yuan

Rang: Liferay Master

Nachrichten: 993

Eintrittsdatum: 26. April 2007

Neue Beiträge

Hi Martin,

Try the following steps. You should get it.

1) prepare virtual hosts in your server, e.g., www.book.com, www.bookstreet.com

2) set virtual host in Liferay. For example, for community guest, set virtual host (public pages) as www.book.com; and for community bookstreet, set virtual host (public pages) as www.bookstreet.com

Thus, you have new URLs for guest community and bookstreet community.

Please let me know you have any issues ...

Thanks

Jonas Yuan
Cato Aune
RE: Virtual Hosts in 5.2.x
23. Februar 2009 12:37
Antwort

Cato Aune

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 17. Februar 2009

Neue Beiträge

Hi Jonas,

I have the same problem as Martin. I followed your steps above, but I still end up being redirected to /web/guest when I type in http://www.bookstreet.com:8080/ in my browser.


Cato
steve rieger
Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: VirtualHosts
23. Februar 2009 12:44
Antwort

steve rieger

Rang: Expert

Nachrichten: 436

Eintrittsdatum: 11. September 2006

Neue Beiträge

Set the home page in portal-ext file

--
Sent via Blackberry
I can be reached at 310-947-8565
Jonas Yuan
RE: Virtual Hosts in 5.2.x
23. Februar 2009 13:02
Antwort

Jonas Yuan

Rang: Liferay Master

Nachrichten: 993

Eintrittsdatum: 26. April 2007

Neue Beiträge

Hi Cato,

The following are details:

suppose you have page home for Guest: http://localhost:8080/web/guest/home. Now you expect it to be: http://www.book.com:8080/home.

1) go to the portlet Communities, and click on the icon Manage Pages for the Guest;
2) set virtual host - seeing screen-shot.

After saved, type http://www.book.com:8080/home in another browser, you should get the same page as that of ttp://localhost:8080/web/guest/home

Get it?

Thanks

Jonas Yuan
Anhang

Anhänge: virtual-host-01.png (19,1k)
Martin Kofoed
RE: Virtual Hosts in 5.2.x
23. Februar 2009 13:04
Antwort

Martin Kofoed

Rang: New Member

Nachrichten: 15

Eintrittsdatum: 23. Februar 2009

Neue Beiträge

Jonas, thanks a lot for spending some time trying to help out. I'll be using your example site names below for the sake of clarity.

I got a funny observation: when I log in, I am automatically served the front page of the community site (that is: http://www.books.com/web/books). Exactly as expected! However, non-authenticated requests are still always redirected to the http://www.books.com/web/guest page. Could this be the source of the problem?

My virtualhost settings for the "books" community is as follows:

Public Virtual Host: www.books.com
Private Virtual Host:
Friendly URL: /books

Kind Regards,
Martin
Martin Kofoed
RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: VirtualH
23. Februar 2009 13:15
Antwort

Martin Kofoed

Rang: New Member

Nachrichten: 15

Eintrittsdatum: 23. Februar 2009

Neue Beiträge

steve rieger:

Set the home page in portal-ext file


Thanks for the input, Steve, but could you elaborate a bit on this? I couldn't find an obvious entry in the portal.properties template file.

Is it possible to enter n home pages in this manner where n > 1?

Now my friendly urls work (I think), but I still need the mechanism where the initial request to http://www.books.com is redirected to http://www.books.com/frontpage (or http://www.books.com/web/books/frontpage).
Jonas Yuan
RE: Virtual Hosts in 5.2.x
23. Februar 2009 13:19
Antwort

Jonas Yuan

Rang: Liferay Master

Nachrichten: 993

Eintrittsdatum: 26. April 2007

Neue Beiträge

Hi Martin,

Just tested the processes. It sounds good.

Suppose you have page home for Book Street: http://localhost:8080/web/book-street/home. Now you expect it to be: http://www.bookstreet.com:8080/home.

1) go to the portlet Communities, and click on the icon Manage Pages for the Book Street;
2) set virtual host - seeing screen-shot.

After saved, type http://www.bookstreet.com:8080/home in another browser, you should get the same page as that of ttp://localhost:8080/web/book-street/home

Note that, the sites http://www.bookstreet.com:8080/ and http://localhost:8080 are different - check the URLs in your browsers.

Each page needs friendly URL (e.g., /test). Thus, you can refer it as http://www.bookstreet.com:8080/test, for example.

Thanks

Jonas Yuan
Anhang

Anhänge: virtual-host-02.png (19,8k)
Cato Aune
RE: Virtual Hosts in 5.2.x
23. Februar 2009 14:06
Antwort

Cato Aune

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 17. Februar 2009

Neue Beiträge

Hi Jonas,

thank you so much for your help.
I now have the same setup as in your screenshot.

I get to the community page with these URLs:
http://www.bookstreet.com:8080/home
http://www.bookstreet.com:8080/web/book-street/
http://www.bookstreet.com:8080/web/book-street/home
http://localhost:8080/web/book-street/
http://localhost:8080/web/book-street/home

Based on this text on the Virtual Host page

"For example, if the public virtual host is www.helloworld.com and the friendly URL is /helloworld, then http://www.helloworld.com is mapped to http://localhost:8080/web/helloworld"

I assumed that http://www.bookstreet.com:8080/ would send me to http://www.bookstreet.com:8080/web/book-street/ but instead I am sent to http://www.bookstreet.com:8080/web/guest

Is it my assumption that is wrong or should http://www.bookstreet.com:8080/ also have sent me to my community?


Cato
steve rieger
RE: Virtual Hosts in 5.2.x
23. Februar 2009 14:52
Antwort

steve rieger

Rang: Expert

Nachrichten: 436

Eintrittsdatum: 11. September 2006

Neue Beiträge

i just created a sticky page in this forum with how to set this up
Cato Aune
RE: Virtual Hosts in 5.2.x
23. Februar 2009 15:36
Antwort

Cato Aune

Rang: New Member

Nachrichten: 9

Eintrittsdatum: 17. Februar 2009

Neue Beiträge

Hi steve,

thank you very much!

company.default.home.url=/home

in domains/domain1/applications/j2ee-modules/webspace/WEB-INF/classes/portal-ext.properties (using GlassFish) was the missing piece.


Cato
Martin Kofoed
RE: Virtual Hosts in 5.2.x
24. Februar 2009 01:01
Antwort

Martin Kofoed

Rang: New Member

Nachrichten: 15

Eintrittsdatum: 23. Februar 2009

Neue Beiträge

Thanks a lot for helping out, both of you.

company.default.home.url=/home did the trick.

Mastering Liferay Portal surely helps if you're capable of a little portal-ext.properties kung-fu.. :-) But handling a beast like WebSphere Portal is no different in that sense.

Now, a change request would be to have both "www.books.com" and "books.com" redirect to "www.books.com/home". AND perhaps making the whole virtual host administration a little more intuitive, ie. making it a first-class member of the control panel instead of hiding it behind the community PAGE management. Then my httpd conf would be really simple... :-)

But oddities aside, it still works like a charm.
Radu B
RE: Virtual Hosts in 5.2.x
27. Februar 2009 20:16
Antwort

Radu B

Rang: New Member

Nachrichten: 11

Eintrittsdatum: 19. Juni 2008

Neue Beiträge

What is working for me is to set the home page for each virtual host (company) you define directly in the database.

I couldn't find any documentation about this and couldn't find how to set it up using the admin interface.

If you take a look in the table "company" you will see the column "homeURL" which you can set up your home page.

Using portal-ext.properties was not a solution for me, as this property will set the same home page for all your virtual hosts.

I hope this helps.
Ziggy ©
RE: Virtual Hosts in 5.2.x
13. August 2009 10:02
Antwort

Ziggy ©

Rang: Expert

Nachrichten: 293

Eintrittsdatum: 8. Juni 2008

Neue Beiträge

Sorry guys i am a bit confused. What is the difference in the above configuration and changing the defaultLandingPage?

Does this mean that if i want to change the default landing page for a user i can use the above configuration and dont need to modify the DefaultLandingPage.java file? or have i confused the two?
Ziggy ©
RE: Virtual Hosts in 5.2.x
24. August 2009 10:41
Antwort

Ziggy ©

Rang: Expert

Nachrichten: 293

Eintrittsdatum: 8. Juni 2008

Neue Beiträge

Hi,

Where is the sticky?

Thanks
Lisa Simpson
RE: Virtual Hosts in 5.2.x
15. September 2009 15:39
Antwort

Lisa Simpson

Rang: Liferay Legend

Nachrichten: 2034

Eintrittsdatum: 5. März 2009

Neue Beiträge

i didn't see it. We do something similar here with mod_proxy, instead of mod_jk.

For example, I can point www.mydomain.com/accounting to

http://www.mydomain.com:8080/web/accounting

I can also use regular expressions to do matching.