You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jorge Infante Osorio <jo...@uci.cu> on 2011/04/25 01:02:51 UTC
[users@httpd] reverse proxy and liferay
Hi folk.
I´m try to expose a Liferay server to internet using an apache reverse proxy.
My problem are with the URL in the response body. My configuration is this:
The server name is proxy.
Config:
------------------------------------------------------------------
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module /usr/lib/apache2/modules/mod_proxy_html.so
LoadModule xml2enc_module /usr/lib/apache2/modules/mod_xml2enc.so
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
LoadModule substitute_module /usr/lib/apache2/modules/mod_substitute.so
LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
# Prevent Apache from acting like a forward proxy
ProxyRequests off
ProxyPreserveHost Off
ProxyPass /liferay2/ http://casaf.uci.cu:8072/
ProxyPassReverse /liferay2/ http://casaf.uci.cu:8072/
<Location /liferay2/ >
Requestheader unset Accept-Encoding
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|proxy|proxy/liferay2|n"
Substitute "s|casaf.uci.cu:8072|proxy/liferay2|n"
</Location>
.....
#Some others config for another sites.
------------------------------------------------------------------
In some case the links in my pages reference to http://proxy/someoneelse/ but http://proxy/liferay2/someoneelse/
And in some case the links in my pages reference to http://casaf.uci.cu:8072/someoneelse/ but http://proxy/liferay2/someoneelse/
Any help?
Thanks,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
UCI
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] reverse proxy and liferay
Posted by Jorge Infante Osorio <jo...@uci.cu>.
-----Mensaje original-----
De: Jorge Infante Osorio [mailto:jorgeio@uci.cu]
Enviado el: lunes, 25 de abril de 2011 9:30
Para: users@httpd.apache.org
Asunto: RE: [users@httpd] reverse proxy and liferay
-----Mensaje original-----
De: Jason Pyeron [mailto:jpyeron@pdinc.us] Enviado el: domingo, 24 de abril
de 2011 23:51
Para: users@httpd.apache.org
Asunto: RE: [users@httpd] reverse proxy and liferay
> -----Original Message-----
> From: Jorge Infante Osorio
> Sent: Sunday, April 24, 2011 19:03
> To: users@httpd.apache.org
> Subject: [users@httpd] reverse proxy and liferay
>
> Hi folk.
>
> I´m try to expose a Liferay server to internet using an apache reverse
> proxy.
>
> My problem are with the URL in the response body. My configuration is
> this:
Do you have a reason not to use mod_proxy_ajp?
I don´t have a particular reason. In my case I use SSO with CAS and I need
the reverse the CAS server, Liferay and another app.
I made this change in the config to the liferay server:
ProxyPass /liferay2/ ajp://casaf.uci.cu:8003/
ProxyPassReverse /liferay2/ ajp://casaf.uci.cu:8003/
In my server.xml I have this:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8003" protocol="AJP/1.3" redirectPort="8442"
URIEncoding="UTF-8" />
And now the reverse don´t work, the proxy send me to http://proxy/ and not
to http://proxy/liferay2/
More information:
I Access to proxy using ssl: https://proxy/liferay2/ and the access to
casaf.uci.cu:8003 is over plain text.
I resolve this problem with this:
Header edit Location ^https://proxy/ https://proxy/liferay2/
But the another problems with the URL in liferay persist. Any idea?
Jorge.
>
> The server name is proxy.
>
> Config:
> ------------------------------------------------------------------
> LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
> LoadModule proxy_http_module
> /usr/lib/apache2/modules/mod_proxy_http.so
> LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
>
> LoadFile /usr/lib/libxml2.so
> LoadModule proxy_html_module
> /usr/lib/apache2/modules/mod_proxy_html.so
> LoadModule xml2enc_module /usr/lib/apache2/modules/mod_xml2enc.so
> LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
>
> LoadModule substitute_module
> /usr/lib/apache2/modules/mod_substitute.so
> LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
>
> # Prevent Apache from acting like a forward proxy ProxyRequests off
>
> ProxyPreserveHost Off
>
> ProxyPass /liferay2/ http://casaf.uci.cu:8072/
> ProxyPassReverse /liferay2/ http://casaf.uci.cu:8072/
>
> <Location /liferay2/ >
>
> Requestheader unset Accept-Encoding
>
> AddOutputFilterByType SUBSTITUTE text/html
>
> Substitute "s|proxy|proxy/liferay2|n"
> Substitute "s|casaf.uci.cu:8072|proxy/liferay2|n"
>
> </Location>
>
> .....
> #Some others config for another sites.
> ------------------------------------------------------------------
>
> In some case the links in my pages reference to
> http://proxy/someoneelse/ but http://proxy/liferay2/someoneelse/
>
> And in some case the links in my pages reference to
> http://casaf.uci.cu:8072/someoneelse/ but
> http://proxy/liferay2/someoneelse/
>
> Any help?
>
> Thanks,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] reverse proxy and liferay
Posted by Jorge Infante Osorio <jo...@uci.cu>.
-----Mensaje original-----
De: Jason Pyeron [mailto:jpyeron@pdinc.us]
Enviado el: domingo, 24 de abril de 2011 23:51
Para: users@httpd.apache.org
Asunto: RE: [users@httpd] reverse proxy and liferay
> -----Original Message-----
> From: Jorge Infante Osorio
> Sent: Sunday, April 24, 2011 19:03
> To: users@httpd.apache.org
> Subject: [users@httpd] reverse proxy and liferay
>
> Hi folk.
>
> I´m try to expose a Liferay server to internet using an apache reverse
> proxy.
>
> My problem are with the URL in the response body. My configuration is
> this:
Do you have a reason not to use mod_proxy_ajp?
I don´t have a particular reason. In my case I use SSO with CAS and I need
the reverse the CAS server, Liferay and another app.
I made this change in the config to the liferay server:
ProxyPass /liferay2/ ajp://casaf.uci.cu:8003/
ProxyPassReverse /liferay2/ ajp://casaf.uci.cu:8003/
In my server.xml I have this:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8003" protocol="AJP/1.3" redirectPort="8442"
URIEncoding="UTF-8" />
And now the reverse don´t work, the proxy send me to http://proxy/ and not
to http://proxy/liferay2/
Jorge.
>
> The server name is proxy.
>
> Config:
> ------------------------------------------------------------------
> LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
> LoadModule proxy_http_module
> /usr/lib/apache2/modules/mod_proxy_http.so
> LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
>
> LoadFile /usr/lib/libxml2.so
> LoadModule proxy_html_module
> /usr/lib/apache2/modules/mod_proxy_html.so
> LoadModule xml2enc_module /usr/lib/apache2/modules/mod_xml2enc.so
> LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
>
> LoadModule substitute_module
> /usr/lib/apache2/modules/mod_substitute.so
> LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
>
> # Prevent Apache from acting like a forward proxy ProxyRequests off
>
> ProxyPreserveHost Off
>
> ProxyPass /liferay2/ http://casaf.uci.cu:8072/
> ProxyPassReverse /liferay2/ http://casaf.uci.cu:8072/
>
> <Location /liferay2/ >
>
> Requestheader unset Accept-Encoding
>
> AddOutputFilterByType SUBSTITUTE text/html
>
> Substitute "s|proxy|proxy/liferay2|n"
> Substitute "s|casaf.uci.cu:8072|proxy/liferay2|n"
>
> </Location>
>
> .....
> #Some others config for another sites.
> ------------------------------------------------------------------
>
> In some case the links in my pages reference to
> http://proxy/someoneelse/ but http://proxy/liferay2/someoneelse/
>
> And in some case the links in my pages reference to
> http://casaf.uci.cu:8072/someoneelse/ but
> http://proxy/liferay2/someoneelse/
>
> Any help?
>
> Thanks,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] reverse proxy and liferay
Posted by Jason Pyeron <jp...@pdinc.us>.
> -----Original Message-----
> From: Jorge Infante Osorio
> Sent: Sunday, April 24, 2011 19:03
> To: users@httpd.apache.org
> Subject: [users@httpd] reverse proxy and liferay
>
> Hi folk.
>
> I´m try to expose a Liferay server to internet using an
> apache reverse proxy.
>
> My problem are with the URL in the response body. My
> configuration is this:
Do you have a reason not to use mod_proxy_ajp?
>
> The server name is proxy.
>
> Config:
> ------------------------------------------------------------------
> LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
> LoadModule proxy_http_module
> /usr/lib/apache2/modules/mod_proxy_http.so
> LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so
>
> LoadFile /usr/lib/libxml2.so
> LoadModule proxy_html_module
> /usr/lib/apache2/modules/mod_proxy_html.so
> LoadModule xml2enc_module /usr/lib/apache2/modules/mod_xml2enc.so
> LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
>
> LoadModule substitute_module
> /usr/lib/apache2/modules/mod_substitute.so
> LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
>
> # Prevent Apache from acting like a forward proxy ProxyRequests off
>
> ProxyPreserveHost Off
>
> ProxyPass /liferay2/ http://casaf.uci.cu:8072/
> ProxyPassReverse /liferay2/ http://casaf.uci.cu:8072/
>
> <Location /liferay2/ >
>
> Requestheader unset Accept-Encoding
>
> AddOutputFilterByType SUBSTITUTE text/html
>
> Substitute "s|proxy|proxy/liferay2|n"
> Substitute "s|casaf.uci.cu:8072|proxy/liferay2|n"
>
> </Location>
>
> .....
> #Some others config for another sites.
> ------------------------------------------------------------------
>
> In some case the links in my pages reference to
> http://proxy/someoneelse/ but http://proxy/liferay2/someoneelse/
>
> And in some case the links in my pages reference to
> http://casaf.uci.cu:8072/someoneelse/ but
> http://proxy/liferay2/someoneelse/
>
> Any help?
>
> Thanks,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org