Home >Operation and Maintenance >Windows Operation and Maintenance >Detailed introduction on how to set a directory to prohibit script execution in Win2008 r2 IIS7.5
This article mainly introduces the method of setting a directory to prohibit the execution of scripts in Win2008 r2 IIS7.5. Friends who need it can refer to it.
Refer to Wanwang. The server Windows2008 IIS7.5 can make settings to disable scripts. Execution method -------- You need to disable the script execution permission of a certain directory. You can create a web.config file in the directory where you want to disable the script execution permission and add the following code in it:
<?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>
After saving, the folder and subcontainers are set to have only read permissions, but no script execution permissions. If you want to restore script permissions, just deletethe web.config file in this directory.
The above is the detailed content of Detailed introduction on how to set a directory to prohibit script execution in Win2008 r2 IIS7.5. For more information, please follow other related articles on the PHP Chinese website!