My Battle With Wordpress, PHP and DigitalOcean

My Battle With Wordpress, PHP and DigitalOcean

I'm thinking about converting several websites that I host for clients to Wordpress.

These sites are not large or high in traffic, I just need to give my clients some more customization options.

Sure, I could write a bunch of code and let them customize their current pages, but that's not ideal for them or me.

They shouldn't have to pay me to create a bunch of functionality that they can get nearly for free with something like Wordpress.

I am in the business of helping clients create websites and web applications. My time is spent well doing that. It is not spent well, making little tiny tweaks to pages.

They might want to change a word here or upload a photo here or make a completely new page with some content on it.

It's not worth it for them to pay for each of these small things and it's not worth the time for me to do them. It's not that I can't or won't do them, it's just that there must be a better way.

I'm thinking of using Wordpress on Digital Ocean droplets.

I could charge the client a small fee for converting the site to Wordpress. Then they'll have a lot more flexibility and control over their content. They can update when they want and I get out of all the little requests.

The Technical Challenge

How to give them the most reliability and speed for their sites at the lowest cost to me.

There are several different topologies I am considering for this.

NOTE: I am way overthinking this which is part of the fun for me. I regularly go to High Scalability to read posts and dream of how to solve those kinds of problems

All the droplets I spin up on digital ocean are going to be the $5 per month boxes.

My logic for picking the wimpiest droplet is simple. Most applications don't take advantage of multi-core processors. If I pick the droplet with one core I'll get the most bang for my buck. That one core will have a narrow function.

So I wanted to have a box with haproxy as a load balancer and nothing else on that box. Problem is that app takes way too much memory for the size of box I want to use.

I thought about using varnish as my load balancer but it is not cheap on memory either.

My plan is to have two nginx boxes on the other side of my load balancer.

Then it hit me! nginx is in C. It's fast and it's also cheap on memory.

It turns out that you can use nginx as a load balancer as well. So now it makes sense to have an nginx load balancer in front of two nginx web servers.

For a database I think a box dedicated to MySQL is fine and should be efficient enough. I can have a different database dedicated to each Wordpress instance.

WTFpress

The last piece of the puzzle is Wordpress itself. This is where I'm a little confused as I'm no expert.

  1. Should I put Wordpress on each nginx web server?
  2. Can I put more than one domain in each Wordpress instance?
  3. If not, can I have more than one Wordpress instance on a box?
  4. How do I keep the different boxes in sync?

These types of questions were making me re-think my strategy. None of this sounds simple, which is an indicator that I'm on the wrong track.

Perhaps I should have MySQL, Wordpress and nginx on the same box. $5 per month per box. Each domain gets it's own box, call it a day.

For the amount of traffic these sites get it will suffice. The thing I don't like is not having a load balanced site. If the box goes down then the site is down.

While DigitalOcean is nice, some things are annoying. I created a droplet. I chose the Wordpress image and then I realized that it used Apache instead of nginx.

Droplet #1 destroyed

Then I picked the LEMP stack image to save the effort of installing all that. I couldn't find the default password for MySQL in this image. I searched Google, to no avail.

Droplet #2 destroyed

Also annoying about digital ocean, is that I setup an ssh key in the digital ocean admin site. Then I created a new droplet and I picked the key. I setup putty (my SSH client) to use the private key file.

Sometimes the ssh key would work and I'd be in. Other times it would create a droplet and it would ask me for the password to root.

If you select an ssh key during droplet creation, it doesn't send you a password.

Droplet #3 destroyed

I got frustrated. I stopped selecting an image. I stopped picking an ssh key. Now the plan was to just roll my own image.

At this point, I thought about switching to Google's cloud. Of course their cheapest droplet is $30-40 per month vs $5 for digital ocean. So that wasn't an option.

I installed php and nginx and Wordpress and mysql and all the goodies. I got everything working.

I picked a theme, I wrote a post, I installed some plugins.

And that's when everything went batshit crazy.

The Infamous White Screen of Death

I installed 5 or 6 well reviewed Wordpress plugins. Somehow this got me to the Wordpress white screen of death.

It took me a while to figure out that this is what I was seeing. Not being a Wordpress guy, I had no idea the white screen of death was even a thing.

Mary mother of God it is a thing..

The browser goes completely blank. There's no console error, there's no network error. No debugging information of any kind. Just a blank white screen.

I poked around the logs a little on the server. Didn't see much to go on.

I googled. That had some good tips. Rename the plugins folder and the theme folder. Then none of them will be active and the bug will disappear.

That didn't work either. I restarted nginx just for good measure--no dice.

I installed a combination of plugins that did something horrendous to my droplet.

Droplet #4 destroyed

Wordpress powers like 20% of the internet, so it's not hard to see why I'd want to use it. It has a reputation for being awesome and a reputation for being horrible. It also has a reputation for a million other things.

And now because of Wordpress, or perhaps through some flaw of my own, all my droplets lay in ruin. I like to think that since they lived a good clean short life, that they are all in some sort of digital heaven.

Enter the Ghost Assassin

I just needed simplicity in my life. I decided to spin up Ghost.

I remember reading the kickstarter about Ghost and it sounded awesome. It uses node.js and it's performant and most important of all--simple.

It sounds right up my alley.

I saw that DigitalOcean had an image for Ghost. I felt like a child that had touched the stove one too many times.

I flinched at the thought of clicking on that image.

But I clicked it anyway.

It turns out that the ghost image is superb for my purposes. It installed without a hitch and was simple to setup.

If you're interested in trying it out here's an excellent article:
How to Use the DigitalOcean Ghost Application

I followed that article and it worked to a tee.

And that's the end of the excitement. I created my blog with Ghost as a guinea pig and it just works.

Everything was easy to customize and it has performed well.

I'm going to convert some of my clients to Ghost by writing custom themes. If you've been on the fence about Ghost, give it a try! I recommend the DigitalOcean Ghost image, it will save you a fair amount of time with one click.

And even though DigitalOcean caused me some heartburn, I still love it for the same reason I love Ghost: it's simple.

As for Wordpress...I'll always think of you as the one that got away.

If you found this article to be helpful, then you should subscribe here.

Subscribe to our mailing list

* indicates required
Subscribe
X