這篇文章主要介紹了Win2008 r2 IIS7.5制定目錄禁止執行腳本的方法,需要的朋友可以參考下
參考了萬網,伺服器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檔。
以上是Win2008 r2 IIS7.5如何制定目錄禁止執行腳本方法的詳細介紹的詳細內容。更多資訊請關注PHP中文網其他相關文章!