Foros de discusión

PROXY AJP PROBLEM WITH ROOT CONTEXT

Observato Programmer, modificado hace 15 años.

PROXY AJP PROBLEM WITH ROOT CONTEXT

New Member Mensajes: 2 Fecha de incorporación: 29/04/09 Mensajes recientes
Hello forumers,

I need your help to resolve my problem about proxy ajp, and it is a bit related with liferay.

As we know, by default Liferay takes the root context path (/).
It raised problem in our apache web server when we map request path / (slash) to localhost:8080/ as shown by proxy ajp configuration below

ProxyPass / ajp://localhost:8009/

The configuration works well but since we host several applications on the same web server,
all requests those are going not through ajp are simply redirected to root context (Liferay).

I know one of the solution is to move Liferay to a certain context path (not root anymore),
but I'm afraid it would raise some configuration issues or other risks.

My idea is to map the server domain name in a request, so I can give a certain domain name to exclusively redirected through AJP.
Is this even possible? Or I must resort to previous solution (a.k.a moving Liferay to nonroot context).

Thx a lot in advance.
Observato
thumbnail
Olaf Kock, modificado hace 14 años.

RE: PROXY AJP PROBLEM WITH ROOT CONTEXT

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
I believe you are talking about "Named Virtual Hosts" - e.g. multiple servers listening on the same IP address that are differing by their domain name. This is a standard usecase for Apache and should be fairly easy (search for NamedVirtualHost). (this works for http, I believe that https is still not supported by this for technical reasons)

I'm always (except in development) operating Liferay in a different context and have not yet run into problems related to this fact.

Also, if you'd be using "mod_jk" and "JkMount" instead of ProxyPass, I could recommend something I've just recently learned about: "JkUnmount". This enables you to "JkMount /*" to liferay and "JkUnmount /stuff/*" to handle this via apache. Maybe there's an equivalent option for ProxyPass, I just don't know about that.
Observato Programmer, modificado hace 14 años.

RE: PROXY AJP PROBLEM WITH ROOT CONTEXT

New Member Mensajes: 2 Fecha de incorporación: 29/04/09 Mensajes recientes
Olaf Kock
I have done it using mod_jk and 'named virtual host'.
Great thanks.
thumbnail
Lisa Simpson, modificado hace 14 años.

RE: PROXY AJP PROBLEM WITH ROOT CONTEXT

Liferay Legend Mensajes: 2034 Fecha de incorporación: 5/03/09 Mensajes recientes
I've managed it with mod-proxy-ajp

<Location />
Order allow,deny
Allow from all
ProxyPass ajp://localhost:8009/
ProxyPassReverse ajp://localhost:8009/
</Location>


That should do it for you.... it makes the whole :8080 thing invisible to the end user.

CAVEAT: If you're using an Apache front end to handle multiple virtual hosts, this won't work. It will over ride all of the virutal hosts and point everything to the liferay pages.

CAVEAT #2: If you have an existing Liferay instance, you need to know that changing the root context of Liferay to say /portal will add /portal to the front of all your links. Even with relative links, that will break all of your hyperlinks, URL pages, etc. Our solution involves putting the virtual hosts on another server that's only running apache.