如何创建和管理多租户ASP MVC应用程序 [英] How can I create and manage a multi-tenant ASP MVC application

查看:130
本文介绍了如何创建和管理多租户ASP MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建一个使用主机名来确定客户的多租户应用程序。

I want to create a multi-tenant application that uses the hostname to determine the customer.

例如:

CustomerOne.myapp.com
AnotherCo.myapp.com
AndOneMore.myapp.com
...

CustomerOne.myapp.com AnotherCo.myapp.com AndOneMore.myapp.com ...

我可以没有任何问题做数据库和安全性方面,我还可以从URL中的主机名,但是我在努力寻找的是如何创建基本的管道,将允许新客户在线注册,提供他们的公司名称,并为应用程序创建新的URL,随时可以马上使用。

I can do the database and security side with no problems, I can also get the hostname from the URL, but what I am struggling to find out is how to create the basic plumbing that would allow a new customer to sign up online, provide their company name, and for the application to create the new URL, ready to be used straight away.

谁能帮助?

谢谢,

罗布。

推荐答案

我不能回答这个问题完全是,但我可以把它分解一点点。

I can't answer this exactly, but I can break it down a little bit.

要建立一个新的通用子something.myapp.com你需要做两件事情:

To set up a new generic subdomain something.myapp.com you'll need to do two things:

1)通过编程您的ISP添加一些新的DNS条目,这样something.myapp.com指向你的Web服务器。

1) Programmatically add some new DNS entries via your ISP so that something.myapp.com points to your web server.

2)编程设置IIS中的本地绑定,这样something.myapp.com获得引导到正确的网站/虚拟目录/应用

2) Programmatically set the local bindings in IIS so that something.myapp.com gets directed to the right website/virtual directory/application

有设置IIS结合编程<一的一些讨论href=\"http://stackoverflow.com/questions/1408312/programatically-set-an-asp-net-website-bindings-for-an-iis7-site\">here,这也是通过这个论坛的帖子这里,其中提到的 Appcmd.exe的可以用来在运行时设置IIS配置nofollow的

There is some discussion of setting IIS binding programmatically here, which also links through to this forum post here, which mentions that appcmd.exe can be used to set IIS config at run time.

希望这点你在正确的方向...

Hope this points you in the right direction ...

这篇关于如何创建和管理多租户ASP MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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