在tomcat上多次部署同一个应用程序

发布于 2024-12-14 22:39:37 字数 313 浏览 4 评论 0原文

我想在同一个 tomcat 实例上为不同的“客户”多次部署相同的应用程序。 由于我对 tomcat 和其他应用程序服务器没有真正的经验,所以我没有起点。 当我简单地生成像app1.war和app2.war这样的war文件(基于相同的代码)时,它不起作用,因为war文件的名称不同,但项目仍然被称为相同的,所以我认为tomcat很困惑。所以我真的不知道从哪里开始。 另一个起点是每个应用程序有多个 tomcat 会话,但我有一种感觉,这是浪费性能......? 如果您能指出正确的方向,我将不胜感激。

编辑:我对不同的战争文件使用不同的数据库。我认为这就是问题所在。我怎么能改变这个呢? 干杯, 米

I want to deploy the same applications multiple times on the same tomcat instance for different "customers".
Since im not really experienced with tomcat and other application servers i dont have a point to start.
When i simply generate war files like app1.war and app2.war (based on the same code) it doesnt work, bc the war files are named diferent but the project is still called the same, so tomcat is confused i think. So i really dont know where to start.
Another starting point is to have multiple tomcat sessions for each application but i have a feeling that this is a waste of performance...?
I would appriciate if you could point me to the right direction.

Edit: Im using different databases for the different war files. I think that is the problem. How could i chaqnge that?
Cheers,
m

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵性 2024-12-21 22:39:37

它不是 tomcat 设置,而是一种解决方法,但有一些优点,您只需为所有用户修改应用程序一次...

您可以使用 ID 来标识正在访问您的应用程序的用户。

然后在您的应用程序中,您将根据用户 ID 使用不同的数据库......

It's not a tomcat settings, but a workaround, but has some advantages that you only need to modify the application once for all the users...

You can use an ID to identify the user that is accessing your application.

Then in your application you will use a different database based on the userID...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文