如何在asp.net中创建子域? [英] How can I create a subdomain in asp.net?

查看:91
本文介绍了如何在asp.net中创建子域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net C#应用程序中创建子域?我正在使用asp.net门户.在该门户网站中,我需要能够在运行时创建子域.该子域的ftp也必须与主域ftp相同.

How can I create a subdomain in an asp.net C# application? I am working with an asp.net portal. In that portal I need to be able to create the subdomain at runtime. The ftp for that subdomain also needs to be the same as the main domain ftp.

推荐答案

这里有一些工作部件.听起来要求是所有这些都在运行时发生.我确信很多网络托管服务提供商都会深入研究这些问题,并且可能会有自定义解决方案.

There are a handful of working parts here. It sounds like the requirement is that this all happen at runtime. I am sure a lot of web hosting providers are deep into these sets of problems and likely have custom solutions.

DNS :您需要在DNS主机上打开API.如果是LAN环境,则必须检查DNS提供商是否暴露了API. (即Windows Server或任何您的网络操作系统).如果这是一个面向公众的网站,需要通过Internet进行访问,则必须从DNS注册商那里获取这些API.子域是永久性的吗?

DNS: you'll need to have an API open at the DNS host. If it's a LAN environment, you'll have to check your DNS provider on whether they have APIs exposed. (i.e. Windows Server or whatever your network operating system is). If this is a public facing site that needs to be accessed via the internet, you'll have to get those APIs from the DNS registrar. Are the subdomains to be permanent?

IIS :您必须设置通配符映射(即* .mydomain.net).当HTTP请求进入时,ASP.NET页中的逻辑可以确定您正在使用的子域.您可以提取子域,在该子域上执行查找以获取更多信息(客户ID,名称,有效的访问者IP地址范围,所拥有的信息).

IIS: You'll have to setup wildcard mapping, (i.e. *.mydomain.net). When an HTTP request comes in, logic within the ASP.NET page can determine the subdomain that you're working with. You could extract the subdomain, perform a lookup on that subdomain to get more information (CustomerID, names, valid visitor IP address ranges, whathaveyou).

FTP :如果您需要该子域的安全登录名,则必须为这些用户创建AD或本地计算机帐户.如果您想匿名访问,也可以.要设置FTP文件夹,还需要查看一些脚本选项.假设您正在使用IIS的FTP模块.如果您使用的是第三方FTP应用程序,则会使情况更加复杂.他们的API必须进行调查.

FTP: if you require secure logins for that subdomain, you'd have to have created AD or local machine accounts for those users. If you want anonymous access, that's OK too. There are some scripting options that you'll have to look at to have that FTP folder setup as well. That is assuming you're using IIS's FTP module. If you are using a 3rd party FTP application, that complicates the scenario even further. Their APIs would have to be investigated.

Active Directory :如果您需要每个子域的安全访问权限,则必须创建AD用户和/或组.您当然可以将创建用户的脚本分为几组.也许这些用户将位于您的Web服务器本地.如果您要添加其他Web服务器,那么扩展性就不好,但是肯定是可行的.

Active Directory: If you are requiring secure access for each subdomain, you'll have to create AD users and/or groups. You can certainly script the creation of users into groups. Perhaps the users will be local to your web server. That doesn't scale well if you want to add another web server, but it's certainly do-able.

这篇关于如何在asp.net中创建子域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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