WebFaction
Community site: login faq

Hi guys,

I've just installed Node 0.10.43 and jsbin on one of my Webfaction servers.

This installation went fine, I can see the modules installed correctly in Node's directory and I go the default Hello World appearing for Node on my site.

However, I cannot for the life of me get jsbin to appear instead. I've tried configuring the host and port settings in jsbin and also the start command for Node as detailed at the bottom of here:

Webfaction Community: install-nodejs-with-express-framework

All I get is a 502 Bad Gateway message when I try to view the site. Any help or detailed instructions gratefully accepted, thanks.

asked 31 Mar '16, 11:49

zilog8bit
(suspended)
accept rate: 0%


To use jsbin, please create a Node.js 0.10.43 app and note down the app's port. Assign it to a website entry and note down the domain that you are going to use.

Then start an ssh session and run the following commands:

cd ~/webapps/your_node_app
./bin/stop # the default app should not be running and the port it has binded to be free
export PATH=$PWD/bin/:$PATH
npm install -g jsbin
vi config.json

In that file type the following:

{"url":{"host":"your_apps_domain","prefix":"/","ssl":false}}

Change the host value to the domain you are going to use to server the app.

You should now be able to start your app using the following command:

PORT=NNNNN JSBIN_CONFIG=config.json jsbin

where NNNNN is the port assigned from the control panel.

permanent link

answered 31 Mar '16, 13:32

iliasr ♦♦
2.1k14
accept rate: 35%

Thank you iliasr, unfortunately I'm still getting a 502 Bad Gateway. I've removed the previous application via the Webfaction control panel, created a new one and followed your suggestions down to the letter and still no luck :(

(31 Mar '16, 20:29) zilog8bit

Ilias' procedure worked for me, but with a couple of changes.

First, I had to add the "static" parameter to my config, like this:

{
  "url":{
    "host":"mydomain.com",
    "prefix":"/",
    "ssl":false,
    "static":"http://mydomain.com"
  }
}

Then, I dropped the environment variables for PORT and JSBIN_CONFIG, and instead used the appropriate command line options:

jsbin -p 12345 -c config.json

Once I did that, the app was up and running and accessible via the site to which it was assigned.

permanent link

answered 01 Apr '16, 00:17

seanf
12.2k41836
accept rate: 37%

Hi guys, thank you for the input so far, unfortunately still a no-go for me. Not sure what I'm doing wrong.

I spent 14 hours the last two days running through tutorials for Node on a home Ubuntu server and honestly have found it an absolute nightmare to get anything running properly, if at all. I know folks claim Python to be awkward but at least it's logical to learn, even without documentation, Node just doesn't want to do anything.

I'll be dumping jsbin and sticking to online jsfiddles just to check code for a couple of sites but just in case anybody else hits the same issue, here are the errors that I get each time:

path.existsSync is now called `fs.existsSync`.

module.js:340
    throw err;
      ^
Error: Cannot find module 'express/node_modules/connect'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/nativecodeuk/webapps/jsbin/lib/node_modules/jsbin/lib/middleware.js:4:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/nativecodeuk/webapps/jsbin/lib/node_modules/jsbin/lib/app.js:12:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/nativecodeuk/webapps/jsbin/lib/node_modules/jsbin/bin/jsbin:50:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:945:3

If I don't get the errors I either end up with the 502 Bad Gateway and nothing in the server logs or I get the default Hello World app running which I presume is the cron firing it back up when it's taken me more than 20 minutes to make head or tail of what's going on.

permanent link

answered 01 Apr '16, 13:37

zilog8bit
(suspended)
accept rate: 0%

Feel free to raise a support ticket and we can take a look at your deployment.

(01 Apr '16, 13:41) iliasr ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×67
×21
×15
×1

question asked: 31 Mar '16, 11:49

question was seen: 2,650 times

last updated: 01 Apr '16, 13:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM