Foren

Virtual Hosts in 5.2.x

Martin Kofoed, geändert vor 15 Jahren.

Virtual Hosts in 5.2.x

New Member Beiträge: 15 Beitrittsdatum: 23.02.09 Neueste 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! :-)
thumbnail
Jonas Yuan, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

Liferay Master Beiträge: 993 Beitrittsdatum: 27.04.07 Neueste 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, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 9 Beitrittsdatum: 18.02.09 Neueste 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
thumbnail
steve rieger, geändert vor 15 Jahren.

Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: VirtualHosts

Expert Beiträge: 436 Beitrittsdatum: 11.09.06 Neueste Beiträge
Set the home page in portal-ext file

--
Sent via Blackberry
I can be reached at 310-947-8565
Martin Kofoed, geändert vor 15 Jahren.

RE: Re: [Liferay Forums][1. Installation / Deployment / Setup] RE: VirtualH

New Member Beiträge: 15 Beitrittsdatum: 23.02.09 Neueste 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).
thumbnail
Jonas Yuan, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

Liferay Master Beiträge: 993 Beitrittsdatum: 27.04.07 Neueste 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
Martin Kofoed, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 15 Beitrittsdatum: 23.02.09 Neueste 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
thumbnail
Jonas Yuan, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

Liferay Master Beiträge: 993 Beitrittsdatum: 27.04.07 Neueste 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
Cato Aune, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 9 Beitrittsdatum: 18.02.09 Neueste 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
thumbnail
steve rieger, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

Expert Beiträge: 436 Beitrittsdatum: 11.09.06 Neueste Beiträge
i just created a sticky page in this forum with how to set this up
Cato Aune, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 9 Beitrittsdatum: 18.02.09 Neueste 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
Radu B, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 11 Beitrittsdatum: 19.06.08 Neueste 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.
thumbnail
Ziggy ., geändert vor 14 Jahren.

RE: Virtual Hosts in 5.2.x

Expert Beiträge: 293 Beitrittsdatum: 08.06.08 Neueste 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?
Martin Kofoed, geändert vor 15 Jahren.

RE: Virtual Hosts in 5.2.x

New Member Beiträge: 15 Beitrittsdatum: 23.02.09 Neueste 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.
thumbnail
Ziggy ., geändert vor 14 Jahren.

RE: Virtual Hosts in 5.2.x

Expert Beiträge: 293 Beitrittsdatum: 08.06.08 Neueste Beiträge
Hi,

Where is the sticky?

Thanks
thumbnail
Lisa Simpson, geändert vor 14 Jahren.

RE: Virtual Hosts in 5.2.x

Liferay Legend Beiträge: 2034 Beitrittsdatum: 05.03.09 Neueste 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.