简体   繁体   English

1台服务器上的Playframework 2.5.x 2项目

[英]Playframework 2.5.x 2 Project On 1 Server

I Actually new using playframework. 我实际上是使用playframework的新手。

Usually im using j2ee & jboss, and now im migrating to playframework. 通常我会使用j2ee和jboss,现在会迁移到playframework。

in j2ee using jboss, if i have 2 .ear project, for example, 1 for ecommerce engine and another for payment engine, in production i can just put that 2 .ear project into jboss. 在使用jboss的j2ee中,如果我有2个.ear项目,例如1个用于电子商务引擎,另一个2个用于支付引擎,则在生产中我可以将2个.ear项目放入jboss。

the question is, how if im using play? 问题是,如果我使用play怎么办?

do i have to create 2 play project and run both app? 我必须创建2个play项目并同时运行两个应用程序吗?

or i create just one project contain 2 database and configuration? 还是我只创建一个包含2个数据库和配置的项目?

Thanks. 谢谢。

1 - You would have to build something like this by using subprojects. 1-您必须使用子项目来构建类似的东西。

https://www.playframework.com/documentation/2.5.x/SBTSubProjects https://www.playframework.com/documentation/2.5.x/SBTSubProjects

In case your projects are independent, consider using nginx as a front end server: set up with nginx . 如果您的项目是独立的,请考虑将nginx用作前端服务器:使用nginx进行设置 It shoud route user connections to different play applications depending on the url string, usually, on the domain part. 通常应在域部分上根据url字符串将用户连接路由到不同的播放应用程序。 Your applications should run on different ports, such as 9001, 9002, etc. This setup allows you to update aplications, turn them on and off, move them between different servers independently. 您的应用程序应在不同的端口(例如9001、9002等)上运行。此设置允许您更新应用程序,打开和关闭应用程序,在不同服务器之间独立移动它们。

The accepted answer suggests using subprojects, it is a good idea, but their intent is not in uniting several application into one; 公认的答案建议使用子项目,这是一个好主意,但是它们的目的不是将多个应用程序组合为一个。 it is more in logical split of you project, and in speeding up the compilation. 它更多的是在项目上进行逻辑拆分,以及在加快编译速度方面。 Another point, that you may like in subprojects, is that different play applications run in different JVMs, so this may be an issue if you server resources are limited. 您可能在子项目中喜欢的另一点是,不同的play应用程序在不同的JVM中运行,因此如果服务器资源有限,这可能是个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM