起初时放了4个css文件然后服务器就卡顿了,不应该啊,然后参考了众多的文章配置,我总结出了以下的问题,就直接把修改部分的代码放上来吧
日志文件过大
删除log里面的access日志文件和error日志文件
主要是httpd.conf配置问题
如果在log日志中出现以下记录
[Sun Oct 31 11:31:20.227527 2021] [mpm_winnt:warn] [pid 528:tid 1956] (OS 64)指定的网络名不再可用。 : AH00341: winnt_accept: Asynchronous AcceptEx failed.
那么可以按下面来操作
在apache中的httpd.conf文件中
搜索一下Directory,把中间那个禁止了(加上#)
<Directory />
AllowOverride none
#Require all denied
Require all granted
</Directory>
搜索一下errorlog,那几行改成下面的
#ErrorLog "logs/error.log"
#ErrorLog "c:/wamp/logs/apache_error.log"
#限制错误日志文件为 1M
ErrorLog "|bin/rotatelogs.exe -l c:/wamp/logs/apache_error-%Y-%m-%d.log 1M"
#每天生成一个错误日志文件
ErrorLog "|bin/rotatelogs.exe -l c:/wamp/logs/apache_error-%Y-%m-%d.log 86400"
搜索一下LogLevel,改成下面的,日志记录等级为warn
LogLevel warn
搜索一下customlog,那几行改成下面的
#CustomLog "logs/access.log" common
#CustomLog "c:/wamp/logs/access.log" common
#CustomLog "c:/wamp/logs/access.log" common
#限制WEB日志文件为 1M
CustomLog "|bin/rotatelogs.exe -l c:/wamp/logs/access-%Y-%m-%d.log 1M" common
#每天生成一个WEB日志文件
CustomLog "|bin/rotatelogs.exe -l c:/wamp/logs/access-%Y-%m-%d.log 86400" common
在文件末尾加上这些话
AcceptFilter http none
AcceptFilter https none
EnableSendfile Off
EnableMMAP off
然后访问超快了