My Web Site

How I Hacked My Own Blog & Crashed It

I didn’t do it on purpose. It started with a ridiculously unimportant thing. I was drafting a post that I would have published yesterday, and wanted to include a picture. For reasons which I haven’t yet figured out, I was never able to load pictures directly into WordPress using the upload function in the Posts editor. A couple of months ago I had the same problem, but somehow managed to upload and include an image anyway. I didn’t write down what I did to get the picture on my server, so I had to start from scratch yesterday. I thought I’d upload the image via FTP into a directory on my server. But I couldn’t figure out which directory. Nothing worked.

Thr trouble began when I started messing around with file access permissions. Those are the little ”drwxr-xr-x” notations you see listed with your files on the server. They’re designed for security, to keep people from accidentally or deliberately messing up your blog. I figured I needed to change permissions to give WordPress access to directories. That didn’t make any difference. Oh–and I told the system to change permission on all the subdirectories, too. No difference. So I looked at the WordPress Codex and found a reference to the .htaccess file, and changed the permissions on that. And it all came crashing down. No access to the administrative panel, and no blog on the web any more. And changing permisions on the ht access file made no difference.

I broke into a sweat. What had I done? How to fix it? It’s the danger of knowing a little bit. Too little. And being careless in not considering the possibility of unintended consequences. I would have tried setting permissions individually, if I’d had any idea where to find a list. Information I did find suggested using the tightest settings possible (for security). But after fiddling with some changes, to no avail, I gave up. I transferred all the WordPress files on the web server to my local hard disk. I went into the SQL database and exported it to my hard disk in three different formats. I spoke with Andrew at BRI, my hosting provider, who concurred with me that I was probably going to have to do a re-install. He was getting ready to go away, pressed for time, and couldn’t spend too much time tinkering.

I had my backups. I looked at the SQL backup to make sure it looked like everything was in it (I’ve had the experience of backing up files, only to discover that when I need them, they’re empty). I deleted WordPress from the server and reinstalled it, restored my WordPress files, and imported the SQL database into the fresh WordPress database. And nothing worked.

Cutting to the chase: the trouble began mid-morning on Thursday. It’s now late on Friday afternoon. I have spent many, many hours installing, removing, reinstalling, looking up questions for help with obstacles. It’s all back up and running now. Here are key steps that I offer anyone who may have stumbled on this via Google, finding themselves in the same situation:

  1. My original installation of WP was version 2.0, which I had then immediately upgraded to 2.7 before I installed my theme or anything else. The successful reinstall required starting with 2.0 and carefully following upgrade directions to 2.7 in the WP Codex. http://codex.wordpress.org/Upgrading_WordPress. Even though the crashed version was 2.7, when I attempted to start with that version in reconstruction of the blog, it wouldn’t work. However, I made so many other mistakes due to stress and fatigue that I can’t say for sure whether it would work if I’d been more observant and known then what I’ve learned since.
  2. I assigned the same name to the new installation of the database that I had used for the original installation. I don’t know whether this is necessary.
  3. Check the admin dashboard and make sure any plugins are deactivated
  4. Install your theme
  5. In the SQL database, “Drop” all tables before importing your exported backup SQL file (PHPAdmin is installed on my server and provides easier database access)
  6. Finally, I had overlooked transferring the htaccess file from my hard disk back onto the server. When I discovered that and uploaded it, everything returned to normal, the way it was before.

I take technology somewhat for granted, and tend to forget that the way it really works is pretty much beyond my knowledge and ability. I also forget that it has taken many years to learn what I know about it, and what seems easy and familiar now is just the tip of the iceberg. I didn’t stop to consider what I didn’t know. I’m glad that it was my own blog and not someone else’s that I screwed up. And I’m glad that the blog is young and doesn’t have a big following yet. That minimized the impact on my business.

All seems to be well now (knock on wood). Live and learn.

P.S. Now I can upload pictures directly. It may have been nothing more complicated than the possibility that I was trying to upload image files that were just too big. Doh!

[Post to Twitter] Tweet This Post 

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>