掲示板

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

thumbnail
12年前 に Balázs Jilling によって更新されました。

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

Junior Member 投稿: 32 参加年月日: 10/11/18 最新の投稿
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
12年前 に Vilmos Papp によって更新されました。

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

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
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
12年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
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
12年前 に Balázs Jilling によって更新されました。

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

Junior Member 投稿: 32 参加年月日: 10/11/18 最新の投稿
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
12年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14914 参加年月日: 06/09/02 最新の投稿
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.