当前位置 主页 > 服务器问题 > win服务器问题汇总 >

    Win2008 r2 IIS7.5制定目录禁止执行脚本的方法

    栏目:win服务器问题汇总 时间:2018-09-21 09:16

    这篇文章主要介绍了Win2008 r2 IIS7.5制定目录禁止执行脚本的方法,需要的朋友可以参考下

    之前IIS7站长之家发布过一篇文章具体的可以参考这篇文章:

    //www.iis7.com/article/56566.htm

    参考了万网,服务器Windows2008 IIS7.5可以做一下设置禁用脚本的执行方法--------需要禁止某个目录的脚本执行权限,您可以在要禁用脚本执行权限的目录建立一个web.config文件,里面加入下面的代码:

    <?xml version="1.0" encoding="UTF-8"?><configuration>  <system.webServer>    <handlers>      <remove name="ASPClassic" />      <remove name="PHP-FastCGI" />      <remove name="ASPNET-ISAPI-1.1-AXD" />      <remove name="ASPNET-ISAPI-1.1-HttpRemotingHandlerFactory-rem" />      <remove name="ASPNET-ISAPI-1.1-HttpRemotingHandlerFactory-soap" />      <remove name="ASPNET-ISAPI-1.1-PageHandlerFactory" />      <remove name="ASPNET-ISAPI-1.1-SimpleHandlerFactory" />      <remove name="ASPNET-ISAPI-1.1-WebServiceHandlerFactory" />      <remove name="AssemblyResourceLoader-Integrated" />      <remove name="AXD-ISAPI-2.0" />      <remove name="AXD-ISAPI-2.0-64" />      <remove name="HttpRemotingHandlerFactory-rem-Integrated" />      <remove name="HttpRemotingHandlerFactory-rem-ISAPI-2.0" />      <remove name="HttpRemotingHandlerFactory-rem-ISAPI-2.0-64" />      <remove name="HttpRemotingHandlerFactory-soap-Integrated" />      <remove name="HttpRemotingHandlerFactory-soap-ISAPI-2.0" />      <remove name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" />      <remove name="PageHandlerFactory-Integrated" />      <remove name="PageHandlerFactory-ISAPI-2.0" />      <remove name="PageHandlerFactory-ISAPI-2.0-64" />      <remove name="Perl-CGI" />      <remove name="Perl-ISAPI" />      <remove name="rules-64-ISAPI-2.0" />      <remove name="rules-Integrated" />      <remove name="rules-ISAPI-2.0" />      <remove name="SecurityCertificate" />      <remove name="SimpleHandlerFactory-Integrated" />      <remove name="SimpleHandlerFactory-ISAPI-2.0" />      <remove name="SimpleHandlerFactory-ISAPI-2.0-64" />      <remove name="svc-Integrated" />      <remove name="svc-ISAPI-2.0" />      <remove name="svc-ISAPI-2.0-64" />      <remove name="TraceHandler-Integrated" />      <remove name="TRACEVerbHandler" />      <remove name="WebAdminHandler-Integrated" />      <remove name="WebServiceHandlerFactory-Integrated" />      <remove name="WebServiceHandlerFactory-ISAPI-2.0" />      <remove name="WebServiceHandlerFactory-ISAPI-2.0-64" />      <remove name="xoml-64-ISAPI-2.0" />      <remove name="xoml-Integrated" />      <remove name="xoml-ISAPI-2.0" />    </handlers>  </system.webServer></configuration>

    保存后就设置了该文件夹以及子容器只有读的权限,而没有脚本执行权限。如果要恢复脚本权限就直接删除该目录下的web.config文件。