每当我在IIS7pipe理器中为网站添加处理程序映射时,它总是将处理程序添加到网站的本地web.config文件中。
有没有办法告诉pipe理器只将处理程序映射添加到applicationHost.config的站点configuration中,例如:
<location path="Test Site"> <system.webServer> <handlers> <clear /> <add name="PHP-FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="c:\php\php-cgi.exe" resourceType="Either" /> <-- Other handler mappings here --> </handlers> <security> <authentication> <anonymousAuthentication enabled="true" userName="i_test" password="[enc:AesProvider:snipped:enc]" /> </authentication> </security> </system.webServer> </location>
我知道如何使用appcmd使用/commit:apphost开关来做到这一点,但通过UI实现这一点很好。
IISpipe理器有目的地将设置设置在允许的最低级别。 由于您可以在网站的web.config中设置,它将始终应用于此。
IISpipe理器本身不给你一个select在哪里设置它。 原因是它会很快变得对普通pipe理员感到困惑和混乱,因为applicationHost.config中的设置在web.config中也会被忽略。 所以确保没有混淆的最简洁的方法是在允许的最低级别上应用它。
解决scheme(除了appcmd或直接编辑applicationHost.config)是使用IISpipe理包中的configuration编辑器(它默认安装在WS08 R2上的IIS 7.5上)。 这确实可以让你select你想要应用的设置。
实际上,为了完整,尽pipe对于处理程序来说通常不是一个有价值的选项,但可以closures对该站点或服务器的处理程序的委派。 然后IISpipe理器将它设置在applicationHost.config中。