Fórum
Last Login IP
Wessel Oosthuizen, modificado 10 Anos atrás.
Last Login IP
Junior Member Postagens: 25 Data de Entrada: 09/08/12 Postagens Recentes
Hello,
In the database User_ table there is a column for last login ip. This is supposed to be the client IP address if I understand it correctly. However, my Liferay instances are behind a load balancer, so it always records the load balancer IP address in that column.
I know that you can look for the "X-Forwarded-For" header for the correct ip, however if I can avoid writing code for this it would be great. Is there maybe a property I can set somewhere to solve this?
Thanks
In the database User_ table there is a column for last login ip. This is supposed to be the client IP address if I understand it correctly. However, my Liferay instances are behind a load balancer, so it always records the load balancer IP address in that column.
I know that you can look for the "X-Forwarded-For" header for the correct ip, however if I can avoid writing code for this it would be great. Is there maybe a property I can set somewhere to solve this?
Thanks
Amos Fong, modificado 10 Anos atrás.
RE: Last Login IP
Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
If you're using tomcat, you can use the RemoteIpFilter. You just need to configure web.xml to use it.
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/filters/RemoteIpFilter.html
https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/filters/RemoteIpFilter.html