当前位置:网站首页>【207】Apache崩溃的几个很可能的原因,apache崩溃几个
【207】Apache崩溃的几个很可能的原因,apache崩溃几个
2022-06-26 16:01:00 【米洛口】
近来网站访问量增加很快,于是出来一大堆问题,折腾了好几天,记下一些操作总结,共享之,先说说Apache崩溃的一些可能性和相应的处理方法,从最简单的排查:
1,磁盘空间不足
这是最容易忽视的问题,现在的磁盘便宜,一般人的机器磁盘的空间都是有很多剩余的,不要想当然的认为不是你磁盘空间的问题,也许是日志?或者是你的缓存文件突然吃光了你的磁盘呢?df -h一下很容易的事情,磁盘空间不足会造成很多怪异的现象,Apache进程不断堆积不释放,由于出现“could not make child process * exit,attemption to continue anyway…”之类的错误日志,最后Apache吃掉整个机器的内存,SSH不能登录,不能Reboot,不能Kill进程,,只能强行重启了
2,检查Apache的日志达到2G!!
通常对自己的日志都有一个大概的估计,但检查一下Apache的日志大小也是很有必要的,特别是Apache的Access日志,但近来一些极端无聊的所谓的垃圾人,不断扫描你的机器的目录,试图在你机器上下载你的Wwwroot.rar,下载你的Data.mdb,草,还在你的PHP的脚本目录里面扫描你的Upload.asp文件,(做个Rewrite,喂给这些扫描一些木马或者广告,呵呵,我就是这么干的),这样的垃圾人给Apache的Error日志产生很多垃圾信息。 如果Apache日志达到2G(限制),Apahce很可能出现一些无法解释的怪异的现象,Httpd进程无法启动,或者一启动,马上又停掉。
3,DDos攻击
通常这类的方法检查和处理比较麻烦,排除了你机器本身原因,Apache配置的原因,发现Apache的还是不停的崩溃,哪监测一下服务器网络连接情况,用脚本看一下连接情况:netstat -na|grep ESTABLISHED|awk ‘{print $5}’|awk -F: ‘{print $1}’|sort|uniq -c|sort -r -n,或者统计一下请求过多的的IP(netstat -an | grep -v LISTEN | awk ‘{print $5}’ | awk ‘BEGIN { FS=”:” } { Num[$1]++ } END { for(i in Num) if(Num[i]>8) { print i} }’ | xargs -i[] iptables -I INPUT -s [] -j DROP),直接封掉他们 ,对DDos通常是没有较好软防,如果资金允许,哪买好点的硬防吧。
我有执行上面的命令,可能就是执行上面的防止ip请求过多的情况。
对于DDos攻击,主机托管在外地,或者去机房不方便,哪就很难监测和处理,等你机器崩溃的时候,你远程SSH根本进不去了,郁闷之极。
Apache有一个防DDos的模块mod_evasive(mod_evasive的安装看这里),没法评价其效果,但至少可以帮你记录DDos过来的IP,实在太过份的DDos,哪直接报警。
边栏推荐
- 「干货」NFT 上中下游产业链全景分析
- Kept to implement redis autofailover (redisha)
- 7 自定义损失函数
- 如何辨别合约问题
- The first batch in the industry! Tencent cloud security and privacy computing products based on angel powerfl passed CFCA evaluation
- Exquisite makeup has become the "soft power" of camping, and the sales of vipshop outdoor beauty and skin care products have surged
- 6 自定义层
- 若依打包如何分离jar包和资源文件?
- MHA switching (recommended operation process)
- 【思考】在买NFT的时候你在买什么?
猜你喜欢

基于 MATLAB的自然过渡配音处理方案探究

Svg canvas canvas drag

Solana capacity expansion mechanism analysis (2): an extreme attempt to sacrifice availability for efficiency | catchervc research

Stepn débutant et avancé

IntelliJ idea -- Method for formatting SQL files

Development, deployment and online process of NFT project (1)

9 use of tensorboard

Exquisite makeup has become the "soft power" of camping, and the sales of vipshop outdoor beauty and skin care products have surged

SVG大写字母A动画js特效

Solana扩容机制分析(1):牺牲可用性换取高效率的极端尝试 | CatcherVC Research
随机推荐
Practice of federal learning in Tencent micro vision advertising
1 张量的简单使用
Development, deployment and online process of NFT project (2)
R language plotly visualization: Violin graph, multi category variable violin graph, grouped violin graph, split grouped violin graph, two groups of data in each violin graph, each group accounts for
神经网络“炼丹炉”内部构造长啥样?牛津大学博士小姐姐用论文解读
Development, deployment and online process of NFT project (1)
Simple use of tensor
Analyse panoramique de la chaîne industrielle en amont, en aval et en aval de la NFT « Dry goods»
Kept to implement redis autofailover (redisha)
NFT transaction principle analysis (1)
Angel 3.2.0 new version released! Figure the computing power is strengthened again
What is the process of switching C # read / write files from user mode to kernel mode?
Panoramic analysis of upstream, middle and downstream industrial chain of "dry goods" NFT
NFT 平台安全指南(2)
NFT 平台安全指南(1)
Handwritten numeral recognition, run your own picture with the saved model
stm32h7b0替代h750程序导致单片机挂掉无法烧录程序问题
零知识 QAP 问题的转化
Redis的ACID
Keepalived 实现 Redis AutoFailover (RedisHA)1