Accesing Ghost AWS Ubuntu Server in production

107 views Asked by At

I'm trying to access my Ghost Blog on AWS Ubuntu Server via http://x.x.x.x:2368, but all i get is site can't be reached.

Here are the steps i made:
- git cloned myBlog
- cd myBlog , npm install --production
- npm start or npm start --production console says site is running OK

Config file

var path = require('path'),
    config;

config = {
    production: {
        url: 'http://127.0.0.1:2368',
        mail: {},
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost.db')
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    },
    development: {
        url: 'http://127.0.0.1:2368',
        database: {
            client: 'sqlite3',
            connection: {
                filename: path.join(__dirname, '/content/data/ghost-dev.db')
            },
            debug: false
        },
        server: {
            host: '127.0.0.1',
        port: '2368'
        },
        paths: {
            contentPath: path.join(__dirname, '/content/')
        }
    },
}

If i try to acces it from my pc via http://x.x.x.x:2368 i get the site can't be reached
- The port 2368 is open on AWS, i also did sudo ufw disable

enter image description here


Testing AWS ports with a simple node app:

var http = require('http');
var port = 2368;
http.createServer(function(req, res){
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello world!\n');
}).listen(port);

console.log('listening on port', port);

Result = works

enter image description here

This means it must be something wrong with the config file from Ghost?

2

There are 2 answers

0
Pankaj Yadav On BEST ANSWER

Use the following setting in config file

url : <external IP>:<port>
server : 0.0.0.0
port : port
8
Deepak Singhal On

I don't think this has anything to do with AWS settings. I will advise you to ssh to the machine and try wget http://localhost:2368 and you will know if site is running or not .