Ghost Blog giving me node.js errors in Production

ghost

Ghost Blog has been giving me lots of node.js errors and page cannot be display errors.  I should have tracked the hours of testing but it was way too many hours devoted to a beta platform.  I have finally solved my issue and have a lot more than I would have if I had not gone through this exercise.

As I mentioned above I was getting a Page Cannot Be Displayed error.  This is when I actually got ghost to start.  When I couldn’t get ghost to start I was getting Node.js errors.  I think error 72 was the most popular.  Basically the problem was that ghost wouldn’t run on the ports I was picking.

The final result is that I got it fixed by editing the config.js file.  In the production section I needed to change the server IP and port numbers.  The server IP ended up being my local IP (192,168.x.x) and the port is port 80.  Originally it listed it as 127.0.0.1.  This worked the first time and I am unsure why it didn’t work the second time or thereafter.

I am going to start from the beginning with a little background on my server.  This is a small atom server running Ubuntu 13.10 sitting on my local network. It’s used for a few things. I have a static IP and a domain name assigned.  The domain name is blog.pcprime.org.  I have it setup this way because pcprime.org points to my EC2 server.

It originally had a LAMP setup but I uninstalled Apache and installed nginx for this project.  I followed instructions located at Gregg Housh’s blog.  The first time I ran through his instructions I ran into a 502 gateway issue.  Starting npm with Sudo fixed that issue.  Ofcourse, when I had a server reboot I couldn’t get ghost to run at all.

I thought my issue was related to a syntax error in config.js.  I am still not sure what happened because no where on the web do I see that I was suppose to change the IP to the local IP address.  I tried my static IP and the domain name.  Neither of them worked for me.

My node.js errors meant that something else was running on the ports I was trying to use.  When I checked the list of ports in use it didn’t say that.  I think even uninstalled nginx and node.js a few times.

I have learned a lot from this experience and while it was more time than I should have spent on it I am glad I went through this exercise.  I wanted to use another blog platform to write about other things that aren’t tech.