Fórum

Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

thumbnail
Balázs Jilling, modificado 12 Anos atrás.

Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

Junior Member Postagens: 32 Data de Entrada: 18/11/10 Postagens Recentes
Sziasztok!

Egy 2 szerveres elrendezés konfigurálásában szeretném a segítségeteket kérni. Adott egy linuxos szerver, amin fut egy Apache HTTP, és mellette egy Windows szerver, amin egy Tomcat + Liferay bundle. A feladat az lenne, hogy ha az Apache-hoz beérkező kérés mondjuk www.weboldal.hu, akkor a windowson futó Liferay-t érjük el, illetve a Liferay által küldött válaszok is ennek megfelelően legyenek továbbítva a kliens felé.

Egyelőre csak félmegoldásaim vannak. Addig sikerült eljutni, hogy bár a kezdőoldal betöltődik, a téma nem (vagy nem teljesen) töltődik be, ergó se képek, se semmi, illetve a linkek se működnek.

Ha van itt valaki, aki profi ebben, ne kíméljen! emoticon

Nagyon szépen köszönöm,
Balázs
thumbnail
Vilmos Papp, modificado 12 Anos atrás.

RE: Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
Szia!

Szerintem legegyszerűbb, ha AJP proxy-t használtok.

Apache-on engedélyezni kell az AJP proxy modult és felvenni két sort a mappeléshez valahogy így:

ProxyPass /apps/foo ajp://backend.example.com:8009/foo
ProxyPassReverse /apps/foo http://www.example.com/foo

a portal-ext.propertiesben, ha van proxy path, akkor:

portal.proxy.path=/apps/foo

plussz ezeket a beállításokat érdemes ellenőrizni:

WebServer settings
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
I've got a page describing how to front Liferay/Tomcat using Apache HTTPd here: https://www.dnebinger.com/wiki/-/wiki/Setup+and+Configuration/Fronting+Liferay+Tomcat+with+Apache+HTTPd+daemon

The only difference would be that your setup has to point to a different host.

If you want to serve static content from Apache, you'll have to copy the directories to the linux box in the appropriate location so they'd be available there. Otherwise just let all requests go through AJP to tomcat for the static content.
thumbnail
Balázs Jilling, modificado 12 Anos atrás.

RE: Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

Junior Member Postagens: 32 Data de Entrada: 18/11/10 Postagens Recentes
Sziasztok!

Nagyon szépen köszönöm a jótanácsokat! Végül megoldódott a probléma, simán AJP-vel.

Az Apache httpd.conf-jába ez került:
<virtualhost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
JkMount /* worker1
</virtualhost>


A workers.properties-be pedig ez:
worker.worker1.port=8009
worker.worker1.host=<a liferayt hostoló szerver ip-je>
worker.worker1.type=ajp13</a>


Nem tudom, hogy ez-e az optimális megoldás, de legalább működik. emoticon
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: Linuxos Apache HTTP szerver + Windowsos alkalmazásszerver elrendezés

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
It is not optimal, but as you said it will work.

To optimize the config, you would copy all of the static content from the windows/Liferay box to the linux/httpd box, then use jkUnmount to feed static files directly from httpd rather than pushing it all from tomcat through httpd.

The downside of this approach is that it makes deployments harder; update a theme graphic, for example, you have to deploy the theme then copy the file(s) up to the httpd directory, etc.

It can be a pain, but it certainly does help offloading the mundane activity from the windows/Liferay box and will in general improve performance. Things do get a bit more complicated once you start adding virtual hosts, multi-tenancy, etc., but those problems can be resolved too.