博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
5000_500
阅读量:2535 次
发布时间:2019-05-11

本文共 6625 字,大约阅读时间需要 22 分钟。

5000

Over the past four or so months, I've been having a hell of a time with seeing 500 errors on my site.  And while I'm on my site a few hours a day, the amount of 500s my visitors must have seem is probably huge.  And that's a problem.  A big, annoying problem.  The following details the situation from start to solution, so read on if you'd like to know how it all came and went.

在过去的四个月左右的时间里,我发现自己的网站上出现了500个错误,这真是令人难过。 而且,尽管我每天要花几个小时在网站上,但访问者必须拥有的500秒钟的访问量似乎很大。 那是个问题。 一个大的烦人的问题。 以下详细介绍了从开始到解决的所有情况,因此,如果您想了解一切的来龙去脉,请继续阅读。

症状 (The Symptoms)

How did I know there was a problem and that it wouldn't be an easy fix?  Well...

我怎么知道有问题,而且这不是一个容易解决的问题? 好...

  • The 500s were being seen on davidwalsh.name and dwf.tw (my short URL / redirector)

    在davidwalsh.name和dwf.tw(我的简短URL /重定向器)上可以看到500
  • While sometimes a page would come up, images and other assets would 500

    虽然有时会出现一个页面,但是图像和其他资产会达到500
  • There was seemingly no pattern -- sometimes I was fast, others slow, others would just 500

    似乎没有规律-有时我快,其他人慢,其他人仅500
  • I ran a Google Page Insights report to see if the problem was just something I was seeing, and Google reported a 500 error.  Not good.

    我运行了Google Page Insights报告,以查看问题是否只是我所看到的,并且Google报告了500错误。 不好。

So all of this started happening more and more frequently.  And I was confused as hell.

因此,所有这些开始越来越频繁地发生。 我很困惑。

变量 (The Variables)

It was really hard to point to one specific issue that could have introduced the 500s.

确实很难指出一个可能引入500年代的特定问题。

  • Around that time I had added more .  I kind of knew what I was doing, and I followed my host's () instructions on how to do it.

    大约在那个时候,我添加了更 。 我有点知道自己在做什么,所以我按照房东( )的说明进行操作。

  • I had upgraded to WordPress 4

    我已经升级到WordPress 4
  • Media Temple had just upgraded my server

    Media Temple刚刚升级了我的服务器
  • Blog traffic was up about 10%

    博客流量增长了约10%
  • WordPress plugins (need I say more?)

    WordPress插件(需要我说更多吗?)

All of these things were happening so what could I easily point to?  Nothing.

所有这些事情都在发生,那么我能轻易指出什么呢? 没有。

我做了什么 (What I Did)

As always I tried to fix the issue myself using process of elimination.

一如既往,我尝试使用消除方法自己解决问题。

  • I disabled any fringe WordPress plugins

    我禁用了任何附带的WordPress插件
  • I removed the gzip directive I had added to the server

    我删除了已添加到服务器的gzip指令
  • I crunched all of my assets even more

    我更努力地处理所有资产
  • I removed non-mission-critical directives from my .htaccess file

    我从.htaccess文件中删除了非关键任务指令

And still none of this made a dent.  Still seeing 500 errors left and right.  WTF.

但这仍然没有造成任何影响。 仍然看到500错误左右。 WTF。

媒体圣殿(大部分)来进行救援 (Media Temple (Mostly) to the Rescue)

At this point I needed to contact Media Temple:  I'm not a server admin and the issue was clearly beyond me.  So the volley of communications with Media Temple went as follows.

在这一点上,我需要联系Media Temple:我不是服务器管理员,问题显然已经超出我的范围。 因此,与Media Temple进行的通讯齐射如下。

  • I was first told that they could not reproduce the error, which started me down a path of fury

    最初我被告知他们无法重现错误,这使我走上了愤怒的道路
  • I was then told to look at the error_log, and this annoyed me.  The log had numerous warnings, notices, and a few errors, but nothing that should take down my site the way it had been.

    然后,我被告知查看error_log,这使我很烦。 日志中有许多警告,通知和一些错误,但是没有什么可以像以前那样使我的网站崩溃。
  • They then ran a site diagnostic for me...but on the wrong (old) server.  Ugh.  Not pleased with that but we were getting somewhere so I was fine with them restarting on the newer server.

    然后,他们为我运行了一个站点诊断程序,但是在错误的(旧)服务器上。 啊。 对此不满意,但是我们到了某个地方,所以我很好,他们可以在较新的服务器上重新启动。
  • Media Temple did further digging, at my tearful pleading, and finally found the issue:  I was being DDOS'd from China.  On a Sunday afternoon, when traffic is always low, there were 2500 (!) open connections to my site.  I was also being hotlinked by a very popular site, apparently.  Damn.

    在我含泪的恳求下,媒体神殿做了进一步的挖掘,最后发现了问题:我是来自中国的DDOS。 在周日下午,当流量始终很低时,有2500(!)个开放连接到我的站点。 显然,我也受到一个非常受欢迎的网站的热链接。 该死的。

So there we go -- being DDOS'd will most definitely kill your site.  So now what?

因此,我们走了-被DDOS肯定会杀死您的站点。 那么现在怎么办?

500预防与前进 (500 Prevention and Moving Forward)

Here's the gameplan for moving on:

这是继续前进的游戏计划:

  • For $79 Media Temple installed fail2ban, a utility which sniffs out malicious attempts and bans offenders.  I receive an email for every ban and thus far I've received 2 dozen.  Most are malicious attempts but a few of them have been bans from failed WordPress logins...from Turkey.  Best $79 I've ever spent (probably not true).

    只需花费79美元,Media Temple就可以安装fail2ban,该实用程序可以侦听恶意尝试并禁止违规者。 我收到每封禁令的电子邮件,到目前为止,我已经收到两打。 大多数都是恶意尝试,但其中有一些是禁止从土耳其登录失败的WordPress ... 我曾经花过的最好的79美元(可能不是真的)。
  • Media Temple also installed (D)DOS Deflate.  "This program will ban connection based DDoS attacks when the connection limit of {x} connections from an IP address is exceeded. This ban will remain in place for 30 minutes after each occurrence."

    Media Temple还安装了(D)DOS Deflate。 “当超过来自IP地址的{x}个连接的连接限制时,该程序将禁止基于连接的DDoS攻击。此禁止将在每次发生30分钟后保持有效。”
  • Media Temple also moved my SSH/SFTP port -- a good move I wish I'd thought of

    Media Temple也移动了我的SSH / SFTP端口-我希望我想到的一个好方法
  • I'm going to start using a CDN again.  I stopped using one because it took too much time for the CDN to refresh when I was in heavy theme development, but using a CDN will prevent hotlinking problems.

    我将再次开始使用CDN。 我停止使用它是因为在进行繁重的主题开发时,CDN花费了太多时间来刷新,但是使用CDN可以防止出现热链接问题。
  • For giggles I added hotlink prevention within my .htaccess file as well:

    对于傻笑,我还在.htaccess文件中添加了防止热链接的功能:
# F*** hotlinkers	
RewriteEngine on RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?davidwalsh.name [NC] RewriteRule \.(js|css)$ - [NC,F,L]

Notice I didn't add image files because I want Twitter, Facebook, and other social networks to pick them up in Twitter cards, etc

请注意,我没有添加图像文件,因为我希望Twitter,Facebook和其他社交网络在Twitter卡等中拾取它们。

总结思想 (Closing Thoughts)

A few opinions and ideas to close my post out:

一些意见和想法可以结束我的帖子:

  • I need to stop thinking problems will work themselves out -- I should have attacked this earlier. My apologies to all of you.

    我需要停止思考问题会自行解决-我应该早点对此进行攻击。 我向大家表示歉意。
  • Take the time to secure your shit -- it only takes a few hours and can save everyone loads of pain.

    花一些时间来保护自己的狗屎-只需几个小时,就可以减轻所有人的痛苦。
  • This is going to make me sound like a world class diva but I'm going to say it anyway:  when you sponsor a blogger, and you know everyone knows the blogger uses you, make a big effort to ensure everything is right.  Configure a fast server, give good support.  Media Temple and I got there in the end but the tediousness of the situation was frustrating.

    这将使我听起来像世界一流的女歌手,但无论如何我都会说:当您赞助博客作者时,并且您知道每个人都知道博客作者使用您时,请尽一切努力确保一切正确。 配置快速服务器,提供良好的支持。 媒体神殿和我最后到达那儿,但情况的繁琐令人沮丧。
  • I still love Media Temple

    我仍然爱Media Temple
  • Please don't DDOS me

    请不要DDOS我

Thanks for reading and good luck in your own fights!

感谢您的阅读并祝您好运!

翻译自:

5000

转载地址:http://nxswd.baihongyu.com/

你可能感兴趣的文章
python闭包与装饰器
查看>>
Acegi 源码解释
查看>>
Activity的几种启动跳转方式
查看>>
LCA最近公共祖先Tarjan(离线)
查看>>
牛客练习赛16 E求值
查看>>
matlab rank
查看>>
Asp.net系列--基础篇(三)
查看>>
css基础
查看>>
如何在tomcat中如何部署java EE项目
查看>>
【Python基础教程第2版】——第二讲:列表和元组
查看>>
小常识
查看>>
使用vscode开发python
查看>>
swift--调用系统单例实现打电话
查看>>
0038-算一算是一年中的第几天
查看>>
51nod 1094 【水题】
查看>>
003.第一个动画:绘制直线
查看>>
ng-深度学习-课程笔记-2: 神经网络中的逻辑回归(Week2)
查看>>
正则表达式的搜索和替换
查看>>
个人项目:WC
查看>>
地鼠的困境SSL1333 最大匹配
查看>>