question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't serve content outside of localhost when following the production instructions

See original GitHub issue

New 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
jlukiccommented, Aug 24, 2016

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.

6reactions
jaswillicommented, May 10, 2015

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 to 0.0.0.0 Ghost will bind to all available interfaces.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache problem? Server side events work in localhost, not in ...
My server is using FreeBSD and my PHP scripts (PHP 8) are also Unix formatted (important for line returns). If you are on...
Read more >
Built-in web server - Manual - PHP
URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit...
Read more >
Moving WordPress From Localhost To Server - Complete Guide
In this article, I'll show you how you can migrate WordPress from localhost to server in simple, easy-to-follow steps, whether you want to ......
Read more >
Configuring a Web Server for Web Deploy Publishing (Web ...
Configure the Web Management Service to allow remote connections, and start the service. Create an IIS website to host the deployed content.
Read more >
How to use HTTPS for local development - web.dev
That's why some APIs that won't work on a deployed HTTP site, will work on http://localhost . What this means is that you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found