I have an Amazon EC2 instance setup with nodes installed. I'm currently using Keystone.js as my cms, but I'm also interested in trying out ghost for blogging. I have set up and elastic ip and my domain is correctly pointed to my amazon instance, but I'm sure how to go about setting up a subdomain such as blog.example.com and having ghost run off of that subdomain. Are there any guides or tips out there to push me in the right direction?
Asked
Active
Viewed 500 times
1 Answers
1
I have not idea what a Ghost blog is. But if you can access the blog using EIP and want to expose this service via a subdomain, you need to create a subdomain in your hostedzone and point that subdomain to the elastic IP using an A record.
If you use Route53 for example. Go to Route53 console, open RecordSets for example.com
from the GUI. Add a new Record by filling in blog
in the subdomain field. Select record type A
. Paste the EIP in the value text area. Click create.
This will update your hostedzone file. After a minute or two, you can use blog.example.com
to access Ghost running at EIP.
(enlarge: right click > open image in a new tab)

Nishant
- 54,584
- 13
- 112
- 127
-
ghost is a nodejs blogging platform(think wordpress but for nodejs). I'm not using nginx or apache, just strictly nodejs, so I'm just unsure how to make a node app(ghost for my case) listen to a subdomain. I definitely think your answer is part of the solution though. The rest is, as I said, associating ghost with the newly created subdomain – mike Feb 19 '14 at 05:24
-
Can you access Ghost using Elastic IP? if not, check if Security Group containing this machine has appropriate port open? If not, open that. You may also want to check if you can access the blog on the host machine. So, `curl
: – Nishant Feb 19 '14 at 05:27` to check if the service is up. -
Yes I can run curl on ghost and it logs the contents of the index file to the terminal, so I'm assuming that means it's up locally on port 8081. Now I just need to figure out how to setup dns records for blog.example.com to hit this port – mike Feb 19 '14 at 17:14
-
By the way, I believe your answer would be exactly what I need were I running ghost on the default port. But I can't create an A name for a port can I? For example, 192.0.2.235:8081 – mike Feb 19 '14 at 17:19
-
No, you cannot mention port in A name record. But then you will be accessing `blog.example.com:8081`. In order to map 8081 to 80 so that you do not need to type the port number in the URL. One solution is to use a proxy in front of Ghost server. You may use Amazon ELB that accepts traffic at port 80 forwards it to 8081. And in create a CNAME record for that ELB DNS. Or can use Port forwarding like http://httpd.apache.org/docs/2.2/vhosts/examples.html#purename – Nishant Feb 19 '14 at 19:20
-
Sorry it took so long for me to accept your answer, but using route 53 was indeed the easiest way to setup the subdomain. Thanks for your help Nishant! – mike Feb 24 '14 at 18:39