首页 > 解决方案 > 从 IIS 中删除同一应用程序的重复文件

问题描述

我在 IIS 中有 X 相同的应用程序(一些代码/exe,但不同的配置文件)。是否可以将重复文件放入某个文件夹?

例如我有应用程序:

Canada.weather.com
usa.weather.com
mexico.weather.com

使用相同的 .dll 和 .exe,但配置不同。

标签: iis

解决方案


正如 Lex 所说,我们不建议您将重复文件放到某个文件夹中。如果其中一个 dll 丢失或没有,它将使所有站点关闭。

如果您仍然想这样做,您可以应用 applicationHost.config 中的设置并将其包装在标签中。

applicationhost.config 文件路径:

%windir%\system32\inetsrv\config\applicationHost.config

每个站点都有自己的位置,您可以在每个位置标签内添加自定义配置。

如下所示,我为“BrandoTestSite”启用了 Windows 身份验证:

<location path="BrandoTestSite">
    <system.webServer>
        <security>
            <authentication>
                <windowsAuthentication enabled="true" />
                <anonymousAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</location>

注意:这种方式可维护性较低。我们不建议您选择这种方式来管理多个应用程序。


推荐阅读