Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added post about hosting the blog, obfuscated my email.
- Loading branch information
Showing
5 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
+++ | ||
date = "2014-12-14T13:52:12-06:00" | ||
draft = true | ||
draft = false | ||
title = "Creating a blog" | ||
|
||
+++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
+++ | ||
date = "2014-12-14T18:42:21-06:00" | ||
draft = false | ||
title = "hosting the blog" | ||
|
||
+++ | ||
|
||
I decided to use Amazon EC2 to host the blog, because they give you 1 year free on a micro instance. Plus I've always wanted to learn how to host something on Amazon's cloud. I'll get a linux instance and put an Apache HTTP server on it. Should be easy enough to do. | ||
|
||
Here's my EC2 management console after signing up for an Amazon account and creating a linux micro instance: | ||
![EC2 Management console](/images/EC2 management console.png) | ||
|
||
It took a bit to then be able to log in. I had to add a security group that allowed SSH login, then used my ssh key generated by Amazon to ssh into the instance. It gave me an error, 'permissions are too open', so I had to change the key permissions to only be readable by my user: `chmod 400 ~/.ssh/macbook.pem`. | ||
![SSH login to instance](/images/ssh login to ec2.png) | ||
|
||
Adding Apache HTTP turned out to be easier than I thought. The linux AMI comes preinstalled with Yum, which is a linux package manager. I just had to `yum install httpd`, then start up the service. I followed this tutorial: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html | ||
|
||
The main gotcha was I hadn't yet added a security group to allow HTTP traffic to my instance. That was fairly easy and fortunately the tutorial pointed it out. I admit I don't understand all the linux-ese but the tutorial fortunately explained what was going on. | ||
|
||
I had to change the hostname and regenerate the site. I suppose I'll try to modify the theme so that it's less dependent on the hostname, but I think it will be easier to just codify that into a deploy script. Generating the site looked like this: | ||
|
||
`hugo --baseUrl="http://ec2-54-149-156-115.us-west-2.compute.amazonaws.com" --theme=hugo-uno` | ||
|
||
I then copied the files from the 'public' folder to /var/www/html on the server using scp. Here's the command: | ||
|
||
`scp -i ~/.ssh/macbook.pem -r ./ ec2-user@ec2-54-149-156-115.us-west-2.compute.amazonaws.com:/var/www/html` | ||
|
||
After that I could navigate to http://ec2-54-149-156-115.us-west-2.compute.amazonaws.com/ in my browser and my blog worked! Hooray! | ||
|
||
I'll probably code all that up into a deploy script, but I'll wait till I get the domain first. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters