IIS 8.5应用程序初始化和Windows身份验证

蒂姆斯

我正在尝试使用IIS 8.5上的应用程序初始化模块来预热Intranet应用程序。设置是正确的,并且可以进行预热,但是,一旦我禁用了匿名身份验证,就不再预加载该应用程序(初始化时访问该站点,内存使用量仅为20mb,而内存使用量约为200mb)。

由于这些是需要身份验证的Intranet应用程序,因此传统上我们始终仅启用Windows身份验证,并禁用匿名身份验证。

我正在寻找一种方法来保留此设置,并进行应用程序初始化。我在此页面上发现IIS正在使用NT AUTHORITY \ IUSR进行请求。

如我所见,我的选择是:

  1. 启用匿名身份验证。
  2. 更改IIS用于发出请求的帐户。

理想情况下,我想禁用匿名身份验证。有谁知道我能做到这一点吗?

斯卡丹

简而言之,我建议允许每个应用程序中的非SSL匿名访问,例如单个Init.aspx页面为此,我在应用程序中添加了这样的页面,并在其中添加了文档,以帮助后续的管理员/开发人员弄清楚如果必须将代码移至新服务器时如何使其工作。

特别是可以帮助我弄清楚如何使其工作的参考是web.config<applicationInitialization>标记参考

这是我添加到我的应用程序中的Init.aspx页面,以防您想使用它的衍生版本:

<%@Page ContentType="text/plain" Language="C#" EnableSessionState="False" EnableViewState="false" AutoEventWireup="false" EnableTheming="false" StylesheetTheme="" Theme="" %>
<%--

The built-in application initialization/preload feature can help in situations where the application takes a while to 
start and/or in situations where some components of the site run as services (e.g. performing scheduled tasks).  This 
feature will make sure that the site is quick when the first user visits the site after a restart and/or will ensure that 
scheduled processes are up and running regardless of when people use the site.

Requirements/procedure for application initialization/preload:
(The procedure is slightly different in versions of IIS before 8.5 because there are no UI options.  Must instead alter
applicationHost.config.  See additional reading for more info.)

1.  Set the app pool for the application to "AlwaysRunning" :
    (IIS Manager > Application Pools > YourAppPoolHere > Advanced Settings... > Start Mode)

2.  Enable Preload: (IIS Manager > Sites> YourSiteOrAppHere > Advanced Settings... > Preload Enabled)

3.  Set initialization properties in the web.config.  e.g.:
      <applicationInitialization doAppInitAfterRestart="true">
        <add initializationPage="/PathToYourApp/Init.aspx" hostName="YourWebsiteNameHere.com" />
      </applicationInitialization>
    See this reference for more info (which can be very important):
    http://www.iis.net/configreference/system.webserver/applicationinitialization

4.  Make the Init.aspx page accessible via HTTP with Anonymous access (which may entail one or more of the following).
      - Set NTFS Permissions on the file to include the IUSR (or Everyone) security principal.
      - Adjust the Authentication, Authorization Rules, IP Address Restrictions, SSL Settings, and any other restrictions 
        for *only* the Init.aspx page:
          4.1  IIS Manager > Sites > YourSiteOrAppHere 
          4.2  Switch from 'Features View' to 'Content View' 
          4.3  Find this Init.aspx page in the right pane and highlight it 
          4.4  Switch back from 'Content View' to 'Features View' once the Init.aspx page is selected.
          4.5  You should now see Init.aspx in the tree view in the left pane.  You can now adjust the access restrictions 
               on just this page (e.g. disable SSL, enable anonymous, etc.)
               Some stuff like this might be in your config:
                 <location path="Init.aspx"><system.webServer><security><authorization>
                   <add accessType="Allow" users="?" />
                 </authorization></security></system.webServer></location>

Additional Reading:

  Some decent guides on installing and enabling Application Initialization:
  http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization
  http://weblog.west-wind.com/posts/2013/Oct/02/Use-IIS-Application-Initialization-for-keeping-ASPNET-Apps-alive

  The reference for the init parameters:
  http://www.iis.net/configreference/system.webserver/applicationinitialization

-----------------------------------------------------

Note that by the time the code gets to this page, the code in your Global.asax Application_Start and/or any 
Application_Start HTTP Modules will already have fired, so you may not have any extra work to do here.  This page could 
simply be a dummy page.

TO DO: Add any extra initialization tasks outside of the comment section here if you really want to. e.g.:
<%
MyAppNameSpace.UtilityClass.DoExpensiveStartupRoutine();
%>

//.. and last, just write some dummy text if you ever want to see this page in a browser:
--%>
Application Initialized.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

IIS 8和Windows身份验证

来自分类Dev

使用Windows身份验证和Web应用程序的IIS与Web应用程序

来自分类Dev

MVC 5和Web API之间的Owin身份验证(单独的IIS应用程序)

来自分类Dev

使用Windows身份验证和模拟的Web应用程序的IIS

来自分类Dev

IIS 8中的.Net Core和Windows身份验证失败

来自分类Dev

托管WCF应用程序IIS身份验证

来自分类Dev

托管WCF应用程序IIS身份验证

来自分类Dev

如何使用WebListener和Windows身份验证将ASP.NET Core应用程序托管在IIS下?

来自分类Dev

如何使用WebListener和Windows身份验证将ASP.NET Core应用程序托管在IIS下?

来自分类Dev

步骤在Web API asp.net 5网站上的IIS 8上启用Windows身份验证

来自分类Dev

IIS中的Asp.Net核心MVC应用程序Windows身份验证

来自分类Dev

从Windows身份验证IIS for PHP应用程序中提取登录信息

来自分类Dev

IIS Express 8与IIS

来自分类Dev

在IIS 8(Windows 8)上部署ASP.Net MVC应用程序时未呈现CSS和JS文件

来自分类Dev

IIS 7.5应用程序初始化(预热)和HTTPS

来自分类Dev

IIS Windows身份验证

来自分类Dev

Windows Phone 8应用程序上的Live Connect SDK是否“身份验证失败”?

来自分类Dev

IIS应用程序初始化未触发到ASP.NET应用程序

来自分类Dev

Rails应用程序,IIS 8.5中具有Windows身份验证的REMOTE_USER属性

来自分类Dev

#nginxhelp在应用程序上具有Windows身份验证的Microsoft IIS服务器的反向代理

来自分类Dev

使用IIS应用程序(网络服务-仅Windows身份验证)-无法访问SQL Server

来自分类Dev

CORS发行IIS 8 Windows Server 2012

来自分类Dev

如何使用cmd在Win2k12机器上的IIS 8上启用Windows身份验证

来自分类Dev

如何在IIS上发布具有表单身份验证的MVC应用程序

来自分类Dev

使用SOAP服务和IIS的Windows身份验证失败

来自分类Dev

IIS 8.5-应用程序初始化不起作用

来自分类Dev

IIS 7.5应用程序初始化1安装失败

来自分类Dev

.NET Core 3-IIS-应用程序初始化不起作用

来自分类Dev

IIS7.5+:这是描述应用程序初始化功能的正确方法吗?

Related 相关文章

  1. 1

    IIS 8和Windows身份验证

  2. 2

    使用Windows身份验证和Web应用程序的IIS与Web应用程序

  3. 3

    MVC 5和Web API之间的Owin身份验证(单独的IIS应用程序)

  4. 4

    使用Windows身份验证和模拟的Web应用程序的IIS

  5. 5

    IIS 8中的.Net Core和Windows身份验证失败

  6. 6

    托管WCF应用程序IIS身份验证

  7. 7

    托管WCF应用程序IIS身份验证

  8. 8

    如何使用WebListener和Windows身份验证将ASP.NET Core应用程序托管在IIS下?

  9. 9

    如何使用WebListener和Windows身份验证将ASP.NET Core应用程序托管在IIS下?

  10. 10

    步骤在Web API asp.net 5网站上的IIS 8上启用Windows身份验证

  11. 11

    IIS中的Asp.Net核心MVC应用程序Windows身份验证

  12. 12

    从Windows身份验证IIS for PHP应用程序中提取登录信息

  13. 13

    IIS Express 8与IIS

  14. 14

    在IIS 8(Windows 8)上部署ASP.Net MVC应用程序时未呈现CSS和JS文件

  15. 15

    IIS 7.5应用程序初始化(预热)和HTTPS

  16. 16

    IIS Windows身份验证

  17. 17

    Windows Phone 8应用程序上的Live Connect SDK是否“身份验证失败”?

  18. 18

    IIS应用程序初始化未触发到ASP.NET应用程序

  19. 19

    Rails应用程序,IIS 8.5中具有Windows身份验证的REMOTE_USER属性

  20. 20

    #nginxhelp在应用程序上具有Windows身份验证的Microsoft IIS服务器的反向代理

  21. 21

    使用IIS应用程序(网络服务-仅Windows身份验证)-无法访问SQL Server

  22. 22

    CORS发行IIS 8 Windows Server 2012

  23. 23

    如何使用cmd在Win2k12机器上的IIS 8上启用Windows身份验证

  24. 24

    如何在IIS上发布具有表单身份验证的MVC应用程序

  25. 25

    使用SOAP服务和IIS的Windows身份验证失败

  26. 26

    IIS 8.5-应用程序初始化不起作用

  27. 27

    IIS 7.5应用程序初始化1安装失败

  28. 28

    .NET Core 3-IIS-应用程序初始化不起作用

  29. 29

    IIS7.5+:这是描述应用程序初始化功能的正确方法吗?

热门标签

归档