Sunday, August 23, 2009

Apache (reverse) proxy for liferay

...by the way (as my last post just described some additional apache tuning) here my full vhost.conf file per each virtual liferay host.

Because there is one additional thing that might be interesting: I use the proxy (actually: Reverseproxy) from apache to map the port 80 to 9080 - and that in a virtual host environment.

So the full vhos.conf looks as follows:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so


RewriteEngine On
RewriteOptions Inherit
RewriteCond %{HTTP_HOST} !^www\.traumtube\.de [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.traumtube.de/$1 [L,R,NE]



Order deny,allow
Allow from all


ProxyPass / http://localhost:9080/
ProxyPassReverse / http://localhost:9080/
ProxyPreserveHost on

2 comments:

  1. Hello,

    I have applied the previous configuration settings to my reverse proxy Apache file.
    Things works except in some (admin) pages, I have a problem with the POST Http method :
    Here the stacktrace :

    10:15:49,991 WARN [PortletRequestProcessor:171] This URL can only be invoked using POST: /group/control_panel/manage?p_p_id=130&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&doAsGroupId=10136&refererPlid=10194&_130_struts_action=/enterprise_admin_settings/edit_company
    10:15:50,062 ERROR [jsp:165] com.liferay.portal.security.auth.PrincipalException: /group/control_panel/manage?p_p_id=130&p_p_lifecycle=1&p_p_state=maximized&p_p_mode=view&doAsGroupId=10136&refererPlid=10194&_130_struts_action=/enterprise_admin_settings/edit_company
    at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:176)
    at com.liferay.portlet.StrutsPortlet.processAction(StrutsPortlet.java:197)
    at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:98)
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:57)
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:632)
    at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:664)
    at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:359)
    at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:604)
    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:428)
    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:195)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:157)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:608)
    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    Any idea?

    Sami

    ReplyDelete
  2. Hi Sami,

    there seems to be a issue in the latest version 5.2.3
    It seems to have been fixed already.
    Means: Latest in the next version it will be fixed

    See this link:
    http://issues.liferay.com/browse/LPS-2652


    Regards,

    Simon

    ReplyDelete

I'm happy about every feedback! :)