Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
William Gosse
Liiferay 6.1 and virtual host problem
May 12, 2012 7:31 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

I'm using Liiferay 6.1 CE GA 1 Tomcat bundle behind an Apache httpd. I have my httpd virtual host file setup to redirect request to tomcat using ajp.

I used this same setup with Liferay 6.0 without any difficulties but am seeing some strange behavior with 6.1. It seem that there were quite a few changes made to the administration of virtual hosts for an individual site, formerly community, such as the new robot configuration stuff.

My problem is that when I put my site url, ex. www.mysite.com, in the public virtual host field I get weird behavior the first time I access the site in a newly open browser. The behavior is that when I first go to sign in or create a new account my home page is immediately re-displayed to me. If i retry either of these two operations they work normal.

As long as I keep my browser open I can sign out and sign in all day long without issue. Soon as I close and then reopen my browser the bad behavior returns.

If I leave the sites public virtual host field empty everything seems to be fine except I can't configure robots for my site which is a problem.

I think a lot of my other recent post about 6.1 all stem from this one virtual host issue.

Any help with this problem would be greatly appreciated.

I wanted to also mention that setting the virtual host url also breaks Facebook authentication on the first attempt as well. If I leave it empty it works Facebook auth works fine. I'm this related to the home page being re-displayed as well on the first access attempt.
Klemens Dickbauer
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 4:46 AM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

I experience same or similar behaviour. It seems to be depending on the infrastructure though. In the office, behind an application proxy, I can reproduce this reliably: After first login attempt I have to reload in Firefox with <Ctrl>-F5, then sometimes I see that I am logged in, sometimes I have to repeat the procedure, sometimes two- or three-times.
At home, where the server runs in my LAN, it works sometimes like it should, sometimes not. Firefox (on Linux) seems to trigger the problem more often than rekonq. I have not digged into the problem too deep, because my users where only complaining mildly... ;)
Could be some caching problem?
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 5:56 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Is this a 6.1 portal that you're working on also? My 6.1 portal is up on a Win2008 R2 server up in EC2.

I see this reload on the first attempt issue with IE, FF, and Chrome so it doesn't seemt to be a browser specific.

I don't experience this issue on my development system where I access Tomcat directly. This leads me to think that its related to an httpd and Tomcat combination. I can't say if this issue exists for other web and app server combinations.

I've tried all the usually portal properties setting that I used on my 6.05 portal with no luck. I've attached my portal-ext.properties to this post.

There seems to have been a lot of changes around site settings for 6.1. I wondering is something there is causing the issue.

I really wish one of the liferay gurus would chime in on this. I may need to drop back to 6.0 if I can't get an answer.

I've kind of got around the issue a little by setting my main portal settings virtual host to a valid url, but not the one my users normally access my portal with. But then I leave the the site settings virtual host empty. This allows my users to access the portal using the normal url without getting the reload of the home page on there first attempt. However this workaround does prevent me from configuring a robot.txt in the site settings.

If I try to access the portal with the other valid url that's in portal settings I get the reload of the home page on my first attempt as well.
Attachments: portal-ext.properties (3.1k)
Klemens Dickbauer
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 5:52 AM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

Yes, I have also 6.1 GA1 with the tomcat bundle, not running on Windows, but on Linux, but that should not make a difference.
I had version 6.0 only very briefly (starting to use Liferay from January), but I cannot remember the same phenomenon there, too.
As said before, I did not take the time to dig into the problem, so I can only speculate with dangerous smattering. emoticon
For me it seems that the browsers (or the proxy cache of apache) do not recognize that after login and return to the entry site that somewhat has changed at all and do take the page out of the cache. That would explain for me, why it works sometimes after hitting F5. Thinking about it, this should be easy to verify - the access log of the Liferay tomcat should not print the hit after the redirect after login, should it?
But maybe I am up a blind allay, I am not very experienced in web applications...
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 6:29 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Trying to reload the page doesn't seem to get it for me. I have to reattempt my sign in or create account a second time to get normal behavior. Are you using AJP between apache and tomcat? I first thought I was doing something wrong there in my apache virtual host file. But I've use this combination of apache and tomcat before on many different apps, including a 6.05 portal, without any similar weird behavior. However, I wouldn't rule out that something needs to be configured there differently for 6.1. I've been really racking my brain on this one.
Klemens Dickbauer
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 6:20 AM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

Yes, I am using ajp13 all the same.
It is directing all traffic to tomcat (JkMount /* ajp13), only a few pages for the google authentication are handled with "SetEnvIf" clauses handled by apache itself.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 6:42 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

I just examined my tomcat access log and I'm seeing the following:

On my first sign in attempt, which fails, I have this log entry:
76.118.185.83 - - [13/May/2012:09:19:24 -0400] "POST /home;jsessionid=E21D703049C3A24C1E825B1A162D5F76?p_auth=ZhsiMJe1&p_p_id=58&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin&_58_doActionAfterLogin=false HTTP/1.1" 404 654

On my second sign in attempt, which suceeds, I have this log entry
76.118.185.83 - - [13/May/2012:09:20:18 -0400] "POST /home?p_auth=ZhsiMJe1&p_p_id=58&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&saveLastPath=0&_58_struts_action=%2Flogin%2Flogin&_58_doActionAfterLogin=false HTTP/1.1" 302 -

The placement of the jsessionid in the first attempt is the only difference I see.
Klemens Dickbauer
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 6:43 AM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

I agree. I also wondered why I often see tha sessionid in the URL even when cookies are allowed in the browser.
I also get a lot errors from the google webmaster interface because of this, but that might be because the webcrowler does not store cookies.
Have you had a look at the tickets that state problems with the jsessionid parameter? Interestingly there seem to have been a change to 6.1 due to a problem with this in 6.0. Maybe this has changed the behaviour in 6.1 now.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 7:31 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

These are the default settings around cookies in the portal.properties file:
#
# Set this to false to disable all persistent cookies. Features like
# automatically logging in will not work.
#
session.enable.persistent.cookies=true

#
# Set this to true to enable sessions when cookies are disabled. See
# LEP-4787. This behavior is configurable because enabling it can break
# certain setups.
#
session.enable.url.with.session.id=true

It seems like the session.enable.persistent.cookies=true is being ignored. I wonder if jsesion is hardcoded in some places by mistake. I see that there were issues with this in the past.

I googled liferay and jsessionid and see some tickets about this issue but they are for older version, but old bugs sometimes have a way of coming back and haunting you sometimes.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 8:17 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

I think I just solved the problem by session.enable.url.with.session.id=false

Thanks Klemens for joining in on this thread this morning. Your suggestion of looking at the tomcat access log was a big help.
Klemens Dickbauer
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 7:47 AM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

I am glad that I was any help, even for just being a discussion sparring partner... ;)
May I ask one more question, though: I also stumbled about this property, but did not dare to switch it off. Afterwards any users with disabled cookies won't be able to login, right? Are there not many peoply anymore who refuse cookies?
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 13, 2012 8:25 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

These days not having cookies enabled would be kind of rare for most user, just like not having javascript enabled would be rare. For IE, FF, and Chrome having cookies enabled is the default. Also Liferay does give a very clear message when a login fails because cookies are not enabled.

Don't get me wrong I think there's still an underlying problem here with Liferay 6.1, but for now I think this is a suitable solution.
gofri _
RE: Liiferay 6.1 and virtual host problem
May 15, 2012 10:24 AM
Answer

gofri _

Rank: Junior Member

Posts: 94

Join Date: March 2, 2007

Recent Posts

Just to report - we had the same problem with previous version, it is not 6.1 specific.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 15, 2012 3:04 PM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Was that 6.06?

I didn't see it in 6.05.
gofri _
RE: Liiferay 6.1 and virtual host problem
May 16, 2012 12:52 AM
Answer

gofri _

Rank: Junior Member

Posts: 94

Join Date: March 2, 2007

Recent Posts

Yes, 6.0.6
Tuomo Kujanpää
RE: Liiferay 6.1 and virtual host problem
May 17, 2012 2:18 AM
Answer

Tuomo Kujanpää

Rank: Junior Member

Posts: 30

Join Date: January 3, 2008

Recent Posts

William Gosse:
I think I just solved the problem by session.enable.url.with.session.id=false.


In Liferay CE 6.1 GA1, also if you set session.enable.url.with.session.id=true, you cannot access e.g. second page (not default page) of the site at the first attempt with the browser. Nothing happens, like a dead link. The second trial is OK. I have had behaviour like this in two different Liferay installations already.

So, session.enable.url.with.session.id=false is preferred also in this case.

Greetings

Tuomo
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 17, 2012 6:53 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Again my point is that this behavior didn't exist 6.05 even with the session.enable.url.with.session.id=true.

It sounds like it started happening with 6.06 and persists in 6.1

session.enable.url.with.session.id=true is the default for all of these 3 of these Liferay version.

I guess I'd liked to know if this is a bug, which it seems to be, and if so is it being addressed in the next release.
Mika Koivisto
RE: Liiferay 6.1 and virtual host problem
May 17, 2012 11:42 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

It's a bug and it's fixed in LPS-25587 which is included in the next release.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 17, 2012 2:30 PM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Thanks for confirming this!
Rob Hall
RE: Liiferay 6.1 and virtual host problem
July 10, 2012 9:22 AM
Answer

Rob Hall

Rank: Junior Member

Posts: 47

Join Date: November 30, 2011

Recent Posts

Is there a patch available?
Hitoshi Ozawa
RE: Liiferay 6.1 and virtual host problem
July 10, 2012 2:46 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

Liferay.com only provides patches to EE customers. CE users have to got to github to look at the code and create a patch themselves.
Rob Hall
RE: Liiferay 6.1 and virtual host problem
July 10, 2012 2:52 PM
Answer

Rob Hall

Rank: Junior Member

Posts: 47

Join Date: November 30, 2011

Recent Posts

I am an EE customer. Is this change going to be in a regular fix pack or do I have to open a ticket to get a patch?
Mika Koivisto
RE: Liiferay 6.1 and virtual host problem
August 27, 2012 11:47 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1501

Join Date: August 7, 2006

Recent Posts

You should check it from support if you haven't already.
William Gosse
RE: Liiferay 6.1 and virtual host problem
May 20, 2012 6:35 AM
Answer

William Gosse

Rank: Regular Member

Posts: 108

Join Date: July 4, 2010

Recent Posts

Tuomo Kujanpää:
William Gosse:
I think I just solved the problem by session.enable.url.with.session.id=false.


In Liferay CE 6.1 GA1, also if you set session.enable.url.with.session.id=true, you cannot access e.g. second page (not default page) of the site at the first attempt with the browser. Nothing happens, like a dead link. The second trial is OK. I have had behaviour like this in two different Liferay installations already.

So, session.enable.url.with.session.id=false is preferred also in this case.

Greetings

Tuomo



Hi Tuomo,

Setting session.enable.url.with.session.id=false should correct this behavior. The only downside to this work around is that users need to have cookies enabled in their browser in order to sign in or create an account..