Hosting Horrors Part 2

Hosting Horrors Part 2
Time to get back to it, hosting your sites that is. Unless you’re reading through the archives. In which case it was just time to click on the link for the next link. Kind of gets rid of the anticipation though doesn’t it?

Setting up your VPS instance

Sign up for Digital Ocean, and then create a droplet. The instructions I’m going to be giving you are for Ubuntu 14.04 LTS. You can use something else instead, but I like Ubuntu quite a lot, your mileage may vary.

There is a great walkthrough I used on Digital Oceans support site here There are a couple of things that I would say though if you are going to be going through this whole walkthrough and using Easy Engine. My first thought when I install a new Linux server is to install MySQL and Apache. You aren’t going to be using Apache and it was a pain to migrate off of it, so I’d recommend against installing it now. Also don’t install MySQL yet unless you have a specific reason to. Let Easy Engine do it and you can save yourself creating a couple of config files and such. It’ll set a random root password that you can change later if you want. It boils down to just setting up your users, specifically one with sudo access. I also usually set my root password in general when I do a new install. You do that by doing the following:

sudo su

Enter in your password then put in

passwd

Set the password and now your root user has a password set. If you want to do a whole lot of root stuff this can be a nice thing. Just realize that you’re going around all of the security that Ubuntu puts in to keep a static root user out. There are occasions when it can be really nice though so just be aware of what you’re doing.

Also make sure that you have openssh-server installed. Make sure that you can SSH into the box. Once you have the DNS setup you can just use user@yourdomain.com where “user” is your username and “domain.com” is any of the domains you pointed at the instance.

Easy Engine

Easy Engine is a piece of software that makes setting up your server infinitely easier. You have to get your VPS setup first though as we went through before. The install process at Easy Engine is pretty good and I’d recommend it. It is basically just running a shell script as root. It allows all of your stack to be installed by Easy Engine.

After that I would recommend running

sudo ee stack install --all

That will install anything that isn’t already installed. Also run

sudo ee stack install -php7

That will allow you to run sites in PHP7 mode. It’s super fast, although a lot of older plugins and themes don’t support it. I tried it out on a clients beta site and the landing page loaded super fast, but it wouldn’t go to any other page. I put it back since I could see them wanting their customers to be able to navigate their site. It’s always something with those people, right?

Creating a site with Easy Engine

Creating a site with Easy Engine is pretty easy. As long as you have your DNS updated and it’s propagated out you can go off to the races.

sudo ee site create yourdomain.com --wpfc --letsencrypt

So lets break that down a bit.

sudo ee site create yourdomain.com

That creates a new site. One of the most basic forms of that is

sudo ee site create yourdomain.com --wp

That creates the site with WordPress. It creates a MySQL database and a user for that database. It installs the newest version of WordPress and then creates a user for you. You can specify that in the config file, but if not it will tell you the login details in the terminal session. I make sure to set my default user as the same email address as my wordpress.com account then I can install Jetpack and enable Single Sign On, and I’m off to the races.

The next part is the

--wpfc

That installs the Nginx cache options for WordPress. There are some faster caching stuff out there, but that enables Memcache and some other goodies. It also tends to just work and I can’t be bothered to mess with my caching options all day long. I’ve tried thw w3tc option (wwwtc super cache) and I’ve had tons of issues getting it to stay working. It’s always something with my .htaccess file. I also make sure to enable the image CDN stuff in Jetpack. If you select jump start when you install it you’ll be good on that. It enables it that way.

The last part is

--letsencrypt

That enables a free SSL cert on it. That’s why I had you create a www A record in your DNS earlier. Lets Encrypt checks for that. It will make a SSL cert for 90 days, but it will also create a cron job that renews it 30 days before it expires for every site you use it on. Pretty cool right? I thought it was. It saved me a ton on SSL certs.

Final Hosting Steps

So your site is installed? Great! Now go to https://yourdomain.com/wp-admin, login, then you’re good to go. I’d recommend installing Jetpack in the plugins section (it’s one of the top featured ones, can’t miss it), activate it, tie it to your wordpress.com account (create one if you don’t have one, they’re free), and click jump start. I also enable monitor on all of my sites so that I get an email if they go down. I also do a couple of other things on all of my new sites, but I’ve already been running pretty long on this. If people are interested I’ll go into my next steps. They’re Google Analytics setup, Google Webmaster Tools, and some email forwarding stuff on the server. Also some WordPress best practices (backup, SEO, Security).

Conclusion

Now you have a functioning web server. Pretty cool right? Now you just have to administer, update, and take care of it (that’s the easy part right?). Do you have a better way of running your web server? Let me know in the comments. Do you have any questions? Let me know in the same place. That’s actually just going to be a good generalization. Correspond in the comments. Yeah, lets go with that.