Web.config 文件配置(用于屏蔽特定IP访问)
配置项 | 描述 |
---|---|
<ipSecurity allowUnlisted="true"> |
允许未列出的IP地址访问,同时可以通过添加规则来限制特定IP或IP段 |
<add ipAddress="127.0.0.1"/> |
允许单个IP地址访问 |
<add ipAddress="192.168.1.0" subnetMask="255.255.255.0"/> |
屏蔽整个IP段 |
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<ipSecurity allowUnlisted="true">
<clear/> <!-- 清除所有之前的IP规则 -->
<add ipAddress="127.0.0.1"/> <!-- 允许单个IP地址访问 -->
<add ipAddress="127.255.255.0" subnetMask="255.255.255.0"/> <!-- 屏蔽整个IP段 -->
<add ipAddress="192.168.1.0" subnetMask="255.255.255.0"/> <!-- 屏蔽另一个IP段 -->
</ipSecurity>
</security>
</system.webServer>
</configuration>
PHP.ini 文件配置(用于修改PHP最大文件上传大小限制)
参数 | 描述 |
---|---|
post_max_size = 20M |
设置POST请求的最大数据量为20MB |
upload_max_filesize = 20M |
设置允许上传文件的最大尺寸为20MB |
memory_limit = 256M |
设置PHP脚本可使用的最大内存量为256MB |
max_execution_time = 600 |
设置脚本执行的最大时间为600秒 |
post_max_size = 20M
upload_max_filesize = 20M
memory_limit = 256M
max_execution_time = 600
批处理脚本(用于修改文件属性成为系统文件并隐藏)
命令 | 描述 |
---|---|
attrib +h +s D:\1.exe |
将指定路径下的文件设置为系统文件并隐藏 |
@echo off
REM 设置文件为系统文件并隐藏
attrib +h +s D:\1.exe
通过这些配置文件的调整,您可以进一步优化网站性能、安全性和用户体验。