Tomcat虚拟主机 [英] Tomcat virtual Host

查看:52
本文介绍了Tomcat虚拟主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上托管了一个应用程序.我希望所有小客户共享一个虚拟主机,我希望为每个大客户设置一个专用的虚拟主机.应用程序完全相同,我可以将虚拟指向同一个代码库目录吗?

I have an application hosted on a server. I want all small customers to share a virtual host and I want setup a dedicated virtual host for each big customer. the applications are totally same, can I have the virtual point to the same codebase directory?

我使用Tomcat 7作为应用服务器,请指教.

I am using Tomcat 7 as application server, please advise.

谢谢

推荐答案

如果他们总是使用同一个应用程序,你可以试试这个.否则更改 appBase,即对于普通客户 (server.xml):

If it always is the same app they are using, you can try this. Otherwise change the appBase, i.e. for a regular customer (server.xml):

<Host name="smallCustomers.com" appBase="webapps" ...>
  ...
</Host>

<Host name="regularCustomer1.com" appBase="webapps" ...>
  ...
</Host>

<Host name="regularCustomer2.com" appBase="webapps" ...>
  ...
</Host>

这篇关于Tomcat虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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