cc licensed flickr photo shared by foreversouls
My blog crashed this afternoon.
I was not driving, but with some lucky bits of intervention and guessing, I was able to roll it over and get it back on the road. This was after spending a good chunk on Sunday on a side blog that had gotten hacked (By the way, Donncha’s Exploit Scanner was a crucial key to cleaning up that one, tho it needs a bump to WP 2.9.1).
But today’s episode of “Blog and Order” was a different game. I thought I’d share some of the things I did- but keep in mind that when something like this happens, there is rarely one single recipe; and like most, I try all kinds of things, though the whole box of tricks at the wall and see what sticks.
So I went to my own blog today to look something up (whatever that was, I now forgot), and the page took a long time of just whiteness, and then I got the dreaded HTTP Server Error 500 – which tells you nothing more than some script on your site is borked.
I looked at my resources on Dreamhost (I run a private server, meaning I can restart the server- that did not help– as well as allocated more RAM to the server — at more $$ over month). I could see that the CPU usage had begun climbing well above normal levels around 3:00 AM; but even throwing more RAM at the site, it still would not load pages.
Next I check other sites hosted on the same domain. They are fine, even one that is WordPress. Then I try a non WordPress URL on my site. That also loads fine. This tells me the problem is in WordPress.
I then download the server error log. The last entries are fill of “index.php: premature end of headers” — again this tells me nothing specific except that somewhere in the chain of PHP scripts WordPress loads when it builds you a page, something borked.
By the way- another Mac tip… access or error logs can be huge files, hard to open in a text editor (BBEdit was having issues with my 180 Mb access.log file); but if you open the file on the Console utility, it manages nicely, and even offers a nice filter option when you are trying to isolate a file name or a rogue IP address.
Maybe all of my billions of fans are frantically pressing reload? I let the server sit a while. Then I decide to take it offline- you can do this easily (I do this when doing a manual update by ftp because you have to remove key files in the process–) I have an alternate index.php file I use as a sign to hang on the door (you can see what it says). Everything in WordPress is routed through this single entry point, so some basic HTML:
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">CogDogBlog Is Offline Please Stand By
Sorry. The dog is not feeling well and until we can get the blog to a vet, the dog shall be sleeping. Please resume your regular web clicking.