在tomcat上多次部署相同的应用程序 [英] deploy the same application multiple times on tomcat

查看:167
本文介绍了在tomcat上多次部署相同的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不同的客户的同一个tomcat实例上多次部署相同的应用程序。
由于我没有真正体验过tomcat和其他应用程序服务器,我没有一点要开始。
当我简单地生成像app1.war和app2.war(基于相同的代码)的战争文件,它不工作,bc战争文件命名为diferent,但项目仍然被称为相同,所以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.

编辑:我为不同的战争文件使用不同的数据库。我认为是这个问题。我该怎么办?
Cheers,
m

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

推荐答案

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

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...

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

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

然后在您的应用程序中,您将使用基于userID的不同数据库...

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

这篇关于在tomcat上多次部署相同的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆