It’s been a while since I wrote my latest post and I didn’t mean to write more before I change how my blog looked, I was looking for a minimalistic UI and planning to design one myself. The design I was planning was a lot more minimalistic then what WordPress was capable of (not capable of running of course but it would be a waste of many things WordPress has to offer) I never needed my posts regenerated by php all the time, so static blogs seemed like a good idea. That’s just when I met ghost and decided to switch to it, but I always hosted my websites on a shared host and never needed more. Well, at least that was the case before. On this post, I’m going to try to tell my experience with a VPS to set up a ghost blog from the eyes of a newbie.
Trying Ghost on Amazon
I tried ghost on localhost, but I wasn’t going to be sure if I could manage a VPS before trying out and Free Tier of Amazon seemed like a good opportunity. So, I set up an account and created a ghost blog there. It was simple enough, once I learned and remembered some terminal commands. I backed up my WordPress posts using this and imported to this new ghost blog (you can go to the import page using this URL domain.com/ghost/debug). Since I already created a robots.txt for not getting indexed, it was ok to put everything there.
I couldn’t be sure if I was going to be charged, even though Amazon’s Free Tier gives you a year for minimal usage. I didn’t feel safe and wanted to find a better place to host a Ghost blog.
Later I found out that Amazon charged me for some things that I don’t know what for, so I closed my account there since I wouldn’t be needing it anymore. Here are the cuts:
2.04 TL on 13/12/13
10.31 TL on 13/12/13
2.63 TL on 26/12/13
A total of 14.98 TL was cut, meaning I soon found out I was right to not feel safe. There are probably fees that I didn’t even understand and since I didn’t know anything about a server management, I can not even guess why, but $5 a month looks cheaper.
Getting Digital Ocean Credit
It was the time of Black Friday and I was in luck. Digital Ocean had a $50 coupon and since I already heard good things about them, I wanted to give them a try. Their $5 a month plan seemed more than enough and it still looks this way. (If you want to sign up do Digital Ocean, doing it by following this link will give me credit and help me to keep my sites up.)
After signing up and creating an Ubuntu server, I didn’t do anything for more than 10 days. Since I didn’t even think about turning the server off for that time period, I was charged for those days (duh). When I decided it was finally time for setting up a ghost blog, I knew I needed to do some reading.
Setting Up a New Server
Although there are options when setting up a new VPS (or droplets as Digital Ocean calls them) such as; a couple Linux distributions and apps like WordPress, ghost. I went ahead and set up an Ubuntu since I wanted to control the system, even though I didn’t really know what to do. Also, I wanted to create multiple ghost blogs in my server and it didn’t look like I could do it with the ghost app (but I was wrong).
After creating an Ubuntu server, I followed two tutorials to be able to install multiple ghosts 1 2. These tutorials both follow the same path even though ordering is not exactly the same, but it doesn’t effect the results.
1. Installing npm 2. Installing Ghost 3. Installing and Configuring nginx 4. Configuring Upstart
So, why do we follow these steps and what each of them does? You can follow one or both of those tutorials as I did, so I’m not going to be copying the same things here for no reason. I’ll just explain what each step does for you, so you might have a better understanding when you decide to do it.
1. Installing npm
npm is the official package manager for Node.js and this is the platform that ghost is built on. So you have to install this to be able to run ghost in the first place.
2. Installing Ghost
On this step, you’ll be getting your ghost files and transferring them to your server. Then you’ll configure it and run it on your server. But, you are not quite done yet, because with these configurations ghost will run as long as you keep that terminal windows open and if you are going to run a site, that’s just ridiculous. That’s where the Step 4 comes into play, it can also be the Step 3 since the ordering of step 3 and 4 doesn’t really change anything, but I found it easier to do it as Step 4. Upstart is going to help you to start your application when you start your Ubuntu server and keep it running. So, after you’re finished with this step and restart your server, ghost will run as long as you don’t tell it otherwise.
3. Installing and Configuring nginx
nginx is what we’re going to be using to transfer people, who comes to your server to a port or a directory that we want. It will take a visitor from port 80 and transfer it to the whichever port you want and in this case whichever port you’re running the ghost on. With nginx you’ll be able to tell your server to take visitors for sitea.com to 126.96.36.199:2368 (server IP:port of ghost blog a) and siteb.com to 188.8.131.52:2369 (server IP:port of ghost blog b). You have to set up your ghost blogs accordingly to make it run like this of course.
This was the tricky part for me, even though it’s working, it doesn’t work the way that it should. And to this day, I couldn’t find out why it doesn’t work for me, as it does for everybody else I could find on the internet. I deleted a server thinking that I did something wrong and started over. Spent a couple days on this, only to find no solution.
4. Configuring Upstart
I didn’t think this part was going to be so easy but I found out that it’s very much like adding an application to the Startup folder on Windows, you’ll either be doing this on terminal or on ftp but you had to do all of those steps this way too, so it’ll be a piece of cake for you.
My adventure of running two ghost blogs with some problems is basically this, I had a little problem while setting up ssh but it was only because I didn’t read it carefully. I didn’t write anything about the safety of your server but you can follow this article for that, including setting up your ssh.