Can't serve content outside of localhost when following the production instructions
See original GitHub issueNew user here. I’m using a Linode Ubuntu VPS and I’ve followed the instructions in the README, then those at http://support.ghost.org/installing-ghost-linux/ (prefixing most commands with sudo
, which is overlooked in the guide), to get Ghost started. In both cases, navigating to myDomain.com:2368 fails with ERR_CONNECTION_REFUSED.
http://support.ghost.org/installing-ghost-linux/#starting-ghost claims that node will listen to 2368, but in actuality I see Your blog is now available on http://my-ghost-blog.com
. Is there an interface binding issue going on? I don’t have a firewall installed on that host yet and I have verified that other node apps work (e.g. Meteor apps listen to port 3000 just fine).
I’ve tried more things in the production instance: change the server in config.js
to my domain, change the port to 80 (and make sure nginx was stopp). No luck.
dandv:/var/www/ghost$ sudo npm start --production
> ghost@0.6.2 start /var/www/ghost
> node index
Migrations: Up to date at version 003
Ghost is running...
Your blog is now available on http://idorecall.com
Ctrl+C to shut down
In another terminal:
$ wget http://idorecall.com
--2015-05-09 18:43:14-- http://idorecall.com/
Resolving idorecall.com (idorecall.com)... 2600:3c01::f03c:91ff:fe37:344d, 45.56.83.107
Connecting to idorecall.com (idorecall.com)|2600:3c01::f03c:91ff:fe37:344d|:80... failed: Connection refused.
Connecting to idorecall.com (idorecall.com)|45.56.83.107|:80... failed: Connection refused.
Accessing the blog on the VPS server works (lynx http://localhost:2368
).
Next, I’ve changed config.production.server.host to my domain name (idorecall.com
), left the port to 80, and Ghost serves content. Totally understandable of a change, but nothing mentioned at http://support.ghost.org/installing-ghost-linux/#starting-ghost, which doesn’t suggest that Ghost should be proxied by a web server either.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
Perhaps default config should consider this use-case (or should be noted in install guide). Makes for a frustrating first time dev experience when server is unavailable outside of localhost.
Hey @dandv, welcome!
First, there’s no
su
/sudo
in the docs because in general it’s better to install and run as a user other than root.Second, I’m pretty sure the trouble you’re having is that by default Ghost (node) is going to bind to your loopback interface (127.0.0.1) and won’t be accessible externally without a proxy (the recommended setup). If you change
config.js
to point to0.0.0.0
Ghost will bind to all available interfaces.