I cannot sign in using domain name but it works fine when using IP address

thumbnail
Abdollah Esmaeilpour, modified 7 Years ago. Junior Member Posts: 60 Join Date: 8/22/09 Recent Posts

I have a Liferay 6.2 instance that can sign in to it using its IP address. But when I want to sign in using its domain, after entering credentials and clicking Sign In button, the Sign In page appears again without any error message nither on UI nor on the Tomcat log. Based on the Tomcat log, the background sign in process works well, but it doesn't redirect to the organization page of signed in user. I traced the redirects and saw that after Sign In page, it is redirected to /c/portal_layout, but in a successful sign-in process (when I browse by IP), it is redirected to an organization page. The other difference I noticed was setting up GUEST_LANGUAGE_ID cookie during the problematic sign-in. In successful sign-in, this cookie is not set. Interestingly, In the problematic scenario following cookies are set too:
LOGIN
PASSWORD
SCREEN_NAME
Moreover, if I enter the wrong credentials, no error messages are displayed and the sign-in page appears again.

thumbnail
David H Nebinger, modified 7 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

When odd things like this happen, I often want to check if there's an HTTP server in front of the app server that might be misconfigured, not sending all traffic to the app server the way it should.

thumbnail
Abdollah Esmaeilpour, modified 7 Years ago. Junior Member Posts: 60 Join Date: 8/22/09 Recent Posts

Thank you David for your quick response.

Yes. There is an HAproxy server in front of Tomcat. I'll work on it.

thumbnail
Abdollah Esmaeilpour, modified 7 Years ago. Junior Member Posts: 60 Join Date: 8/22/09 Recent Posts
As David said, it is an HAproxy issue. This is the solution. HAproxy uses different algorithms for load balancing. Our initial set-up used 'roundrobin'. This algorithm works by using each server behind the load balancer in turns, according to their weights. Click here for more details. Regarding this algorithm, each HTTP response of a successful login on one Liferay instance redirects to another Liferay instance while it is not aware of the login request. By changing 'roundrobin' to 'source' the problem was resolved because this algorithm balances the load regarding the IP address of received HTTP requests. It dedicates each server to some clients. In other words, this algorithm prevents such situations that a client gets responses from different servers, so HTTP sessions don't get missed.