Fórum

Login redirection problem with Apache and Tomcat

Daniel Butts, modificado 12 Anos atrás.

Login redirection problem with Apache and Tomcat

New Member Mensagem: 1 Data de Entrada: 03/01/12 Postagens Recentes
We are using apache and mod_jk to redirect requests on port 80 to Tomcat on port 8080. In order to ensure security, my portlet checks that there is an authenticated user and if there is not, it redirects to the login page. Here is the code that I use in the jsp of my portlet:

<%
if (request.getRemoteUser() == null) {
%>
<script type="text/javascript">
location.replace('/c/portal/login');
</script>
<%
} else {
%>

This redirects to the login page fine and when on the local machine, authentication works normally. However when browsing to Liferay from the Internet (http://myserver.mydomain.com/web/guest/home) the form target of the login page and the URL of the "Return to Full Page" link are http://localhost:8080/web/guest/home.

Liferay appears to be using the absolute url of where it is hosted in Tomcat rather than a relative url. Where have we gone wrong?

Thanks
thumbnail
Ravi Kumar Gupta, modificado 12 Anos atrás.

RE: Login redirection problem with Apache and Tomcat

Liferay Legend Postagens: 1302 Data de Entrada: 24/06/09 Postagens Recentes
I faced this problem.. See this post http://www.liferay.com/community/forums/-/message_boards/message/6895116

Let me know if this solves your problem..