Foros de discusión

Liiferay 6.1 and virtual host problem

thumbnail
William Gosse, modificado hace 11 años.

Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 29 Fecha de incorporación: 5/02/12 Mensajes recientes
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?
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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.
Klemens Dickbauer, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 29 Fecha de incorporación: 5/02/12 Mensajes recientes
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...
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 29 Fecha de incorporación: 5/02/12 Mensajes recientes
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.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 29 Fecha de incorporación: 5/02/12 Mensajes recientes
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.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 29 Fecha de incorporación: 5/02/12 Mensajes recientes
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?
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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 _, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 92 Fecha de incorporación: 2/03/07 Mensajes recientes
Just to report - we had the same problem with previous version, it is not 6.1 specific.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
Was that 6.06?

I didn't see it in 6.05.
gofri _, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 92 Fecha de incorporación: 2/03/07 Mensajes recientes
Yes, 6.0.6
thumbnail
Tuomo Kujanpää, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 32 Fecha de incorporación: 3/01/08 Mensajes recientes
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
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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.
thumbnail
Mika Koivisto, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
It's a bug and it's fixed in LPS-25587 which is included in the next release.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
Thanks for confirming this!
Rob Hall, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 47 Fecha de incorporación: 30/11/11 Mensajes recientes
Is there a patch available?
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
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, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Junior Member Mensajes: 47 Fecha de incorporación: 30/11/11 Mensajes recientes
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?
thumbnail
Mika Koivisto, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
You should check it from support if you haven't already.
thumbnail
William Gosse, modificado hace 11 años.

RE: Liiferay 6.1 and virtual host problem

Liferay Master Mensajes: 533 Fecha de incorporación: 4/07/10 Mensajes recientes
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..