简体   繁体   English

禁用经典ASP而不禁用IIS上的ASP.NET

[英]Disabling Classic ASP without disabling ASP.NET on IIS

BTW this is not something I am want but is a requirement I must follow . 顺便说一句,这不是我想要的,而是我必须遵循的要求 My requirement is to create a user interface that will allow users to disable Classic ASP while allowing ASP.NET 1-4 applications run. 我的要求是创建一个用户界面,该界面将允许用户禁用经典ASP,同时允许ASP.NET 1-4应用程序运行。 Can anyone think of a use case were a user would want to do this? 谁能想到用例,用户是否愿意这样做?

Sure, if you were a web-host offering partial access to a webserver through an application that emulated some of the relevant IIS options, then not only would customers not want the added risk of unneeded script/executable systems running, but you wouldn't either, so you'd want it turned off unless they went in and explicitly turned it on because they needed it. 当然,如果您是一个虚拟主机,可以通过模拟某些相关IIS选项的应用程序提供对Web服务器的部分访问权限,那么客户不仅不希望不必要的脚本/可执行系统运行,而且您也不会要么,所以您希望关闭它,除非他们进入并且因为需要它们而明确将其打开。

Indeed, software for this use-case already exists. 实际上,已经有用于该用例的软件。

Jon's comments about reducing a site's attack surface by removing unwanted features is very valid. 乔恩(Jon)关于通过删除不需要的功能来减少站点的攻击面的评论是非常有效的。 You should ideally just run what you need and no more. 理想情况下,您应该只运行所需的内容,而不必再进行其他操作。

There are a number of ready made commercial solutions to this problem such as Plesk, but they may provide too much functionality for your needs. 有许多现成的商业解决方案可解决此问题,例如Plesk,但它们可能会提供过多功能以满足您的需求。

You could write your own functionality: 您可以编写自己的功能:

If this is IIS6 then you should take a look at the ADSI API which is surfaced via the System.DirectoryServices namespace: 如果这是IIS6,则应查看通过System.DirectoryServices命名空间显示的ADSI API:

Using System.DirectoryServices to Configure IIS 使用System.DirectoryServices配置IIS

To enable/disable scriptmaps you need to manipulate the ScriptMaps metabase property for a site: 要启用/禁用脚本映射,您需要操作站点的ScriptMaps元数据库属性:

ScriptMaps Metabase Property (IIS 6.0) ScriptMaps元数据库属性(IIS 6.0)

If this is IIS7 then take a look at the Microsoft.Web.Administration managed API. 如果这是IIS7,请查看Microsoft.Web.Administration托管的API。 In IIS7 you want to manipulate the handler mappings for a site: 在IIS7中,您要操作站点的处理程序映射:

Handlers <handlers> - IIS.NET 处理程序<handlers> -IIS.NET

In all cases, the user must be a member of the machine's Administrators group. 在所有情况下,用户都必须是计算机的Administrators组的成员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM