WebFaction
Community site: login faq
3
3

Most of the guides here are outdated, and I can't comment (with my low rep).

Also I don't understand how you can just do node app.js - wouldn't that be stopped once you log-off the ssh connection? Is there a way to make it last?

asked 12 Jan '12, 23:28

drozzy
31113
accept rate: 0%

I do maintain the primary WebFaction Community Node.js installation guide. Are you seeing any particular issues with it that I can fix?

(12 Jan '12, 23:42) ryans ♦♦

you need to install forever

npm -g forever

and then run your application with forever

forever start app.js

read dave stevens' fine tut on "real world node.js apps"

permanent link

answered 17 Oct '12, 19:57

marcoslhc
2113
accept rate: 0%

Wish I could upvote this. I hate this whole "have to have rep before you can participate" crap.

(11 Jan '13, 10:13) CorySimmons

@CorySimmons: just bestowed some instant karma in your direction, so you should be able to vote now :)

(11 Jan '13, 11:37) seanf

But how to install forever globally (-g) when you don't have root permissions? Am I right that usually Webfaction accounts have only access to their own home directory + /tmp?

Update: now I understand that when node and npm are installed to with python2.7 configure --prefix=$HOME, then npm install -g installs packages to $HOME/lib/node_modules. Clever.

(16 Mar '13, 05:14) Akseli Palén

@akseli-palen Thanks for the update sure clears things up :)

(26 Mar '13, 06:44) marcoslhc

I'm using forever to run my node app. but after my app run out the memory, webfaction will kill the process, and forever will not restart my app. Any ideas ?

(01 Nov '15, 08:19) ryanouyang

@ryanouyang Make a cron job to restart forever if it isn't running.

(02 Nov '15, 16:26) seanf

When I run forever start app.js I get /usr/bin/env: node: No such file or directory

How to solve that? Thanks

(23 Jun '16, 13:43) micheledt

When I run forever start app.js I get /usr/bin/env: node: No such file or directory

How to solve that? Thanks

Add your app's bin directory to your PATH environment variable. For example, if your app is named "myapp":

export PATH=$HOME/webapps/myapp/bin:$PATH

Once you've done that ,env will be able to locate node and you'll be good to go.

(23 Jun '16, 21:23) seanf
showing 5 of 8 show 3 more comments

Node.js starts itself in daemon mode (see man 3 daemon for more information on the daemon(3) libc function).

If you want to run Node in the foreground but keep it running, it would be done by running it in a screen session. Screen is installed on our systems, and if you spend a lot of time in the SSH terminal, you definitely should check it out. It's essentially a full-featured window manager for the command-line environment.

permanent link

answered 12 Jan '12, 23:42

ryans ♦♦
5.0k93160
accept rate: 43%

edited 12 Jan '12, 23:46

Hi Ryans. Is there an easy way to understand this guide? Something simpler?

(11 Oct '12, 00:15) NeoSwf

Are you referring to the Node.js installation guide?

It's essentially just a bash script, so each line has its own meaning and the installation of software on linux in general is discussed in some very excellent books, such as this one.

However, the actual installation should be very simple - you more or less copy-paste the code line-by-line into an SSH session on the server. Because of that installation guide, developing under node should require far more command-line familiarity than installation does.

(11 Oct '12, 00:24) ryans ♦♦
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

question asked: 12 Jan '12, 23:28

question was seen: 13,072 times

last updated: 23 Jun '16, 21:23

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