{"id":41,"date":"2019-09-17T03:58:13","date_gmt":"2019-09-17T03:58:13","guid":{"rendered":"http:\/\/tensigh.de\/?p=41"},"modified":"2020-08-27T16:18:41","modified_gmt":"2020-08-27T16:18:41","slug":"server-down-panic","status":"publish","type":"post","link":"https:\/\/japanobserver.net\/index.php\/2019\/09\/17\/server-down-panic\/","title":{"rendered":"Server down &#8211; PANIC!!!"},"content":{"rendered":"<p>I thought I would look at my website since I view it so seldom, and lo and behold, IT&#8217;S DOWN!!!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-42\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-6.jpg\" alt=\"PANIC!\" width=\"461\" height=\"334\" \/><\/p>\n<p>First I tried restarting the AWS EC2 instance &#8211; NO SITE!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-42\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-6.jpg\" alt=\"PANIC!\" width=\"769\" height=\"557\" \/><\/p>\n<p>Next, I tried to SSH in, but the IP address has changed since i rebooted.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-43\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-7.jpg\" alt=\"forehead slap\" width=\"525\" height=\"484\" \/><\/p>\n<p>Got the new IP, started SSH, got in. httpd and mysqld aren&#8217;t running (Dufuq?)<\/p>\n<p>Tried restarting them\u00a0 but couldn&#8217;t!!!\u00a0 Have I been hacked?<\/p>\n<p>After I calmed down, I saw that I needed to sudo.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-44\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-8.jpg\" alt=\"Silly me!\" width=\"433\" height=\"368\" \/><\/p>\n<p>Once I did that, I was able to restart httpd and mysqld<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-47\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-9.jpg\" alt=\"Phew!\" width=\"400\" height=\"210\" \/><\/p>\n<p>But now I can&#8217;t see the site in my browser. Clearly this is a Route 53 \/ DNS issue.<\/p>\n<p>Updated DNS entry with new, correct IP address. Now comes the waiting game, as pinging the domain name reveals the old IP address:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-48\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-1a.jpg\" alt=\"First ping test failed\" width=\"663\" height=\"294\" \/><\/p>\n<p>(My OS is in Japanese. Trust me, the pings were timing out).<\/p>\n<p>After a few minutes, the IP address is correct and the site comes up:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-61\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-4a.jpg\" alt=\"Site's up!\" width=\"1168\" height=\"732\" \/><\/p>\n<p>Phew! It&#8217;s nice that the right IP address shows up, but I can&#8217;t test because it&#8217;s not responding to pings:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-50\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-2a.jpg\" alt=\"Ping test 2 success, but no reply\" width=\"661\" height=\"275\" \/><\/p>\n<p>I decided to add a security policy so I can ping just for testing.<\/p>\n<p>Instead of adding it to the main policy, I&#8217;m going to do the &#8220;Photoshop layer&#8221; thing and create a new policy that I can add\/remove at will and apply it to the same EC2 instance.<\/p>\n<p>I created a Echo reply rule and allowed it from anywhere (this is for testing).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-52\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-4.jpg\" alt=\"Custom rules for ping\" width=\"1546\" height=\"179\" \/><\/p>\n<p>Okay, it&#8217;s set for both incoming and outgoing. Great! Let&#8217;s test it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-54\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-5a.jpg\" alt=\"Ping Still failing\" width=\"668\" height=\"210\" \/><\/p>\n<p>Hmmm. Failure.\u00a0 Oh,\u00a0 snap! I need to set the instance itself to allow pings. Duh!<\/p>\n<p>I had to look it up, but I found the iptables command that would work best. I normally wouldn&#8217;t set this to respond to pings from everywhere but this is for testing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-56\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-5.jpg\" alt=\"iptables to the rescue!\" width=\"1440\" height=\"710\" \/><\/p>\n<p>Okay, the security policy is in place, the DNS entry is correct and the iptables\/local firewall is set. Let&#8217;s test again:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-58\" src=\"http:\/\/japanobserver.net\/wp-content\/uploads\/2019\/09\/Blog-pic-7a.jpg\" alt=\"Ping success!!\" width=\"653\" height=\"222\" \/><\/p>\n<p>Success!! I can rest easy now. And since the ping policy is separate from the main security policy, I can turn it off\/on at will, or delete it outright.<\/p>\n<p>I love AWS!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought I would look at my website since I view it so seldom, and lo and behold, IT&#8217;S DOWN!!! First I tried restarting the AWS EC2 instance &#8211; NO SITE! Next, I tried to SSH in, but the IP address has changed since i rebooted. Got the new IP, started SSH, got in. httpd &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/japanobserver.net\/index.php\/2019\/09\/17\/server-down-panic\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Server down &#8211; PANIC!!!&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,10,16],"tags":[17,13],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-aws","category-system-administration","category-system-down-emergency","tag-aws","tag-system-administration"],"_links":{"self":[{"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":11,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":85,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/posts\/41\/revisions\/85"}],"wp:attachment":[{"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/japanobserver.net\/index.php\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}