Quixjote Nova ~ Still Alive!

The Library => Asura Hosting - NodeJS Programming => Topic started by: Noctis on December 05, 2019, 02:48:21 PM



Title: Node on Shared Hosting
Post by: Noctis on December 05, 2019, 02:48:21 PM
Installing Node (CPanel without the node package).
Prior to this working, you will need to request ssh access.

Download a SSH Client (I prefer PuTTy).

Login in to your domain with the port provided by Asura.

On the SSH, login with your username and password.

You are now in the root of your hosting directory.

Getting your first app up and running.


It crashed.  It always crashes.  (Automatic restarts)
NPM makes quick work of this.  From SSH:

Install Forever
Code:
npm install -g forever

Install nodemon (nodemon is not a requirement any longer)

Finally, init forever
Code:
forever -w start index.js 
index.js may be app.js for you.
This checks for file changes and restarts the server and forever again.



Title: Re: Node on Shared Hosting
Post by: Quixjote on December 05, 2019, 03:53:28 PM
The only thing I noticed with mine is when I used forever to launch my app, I had to specify the directory since I didn't install at base level. so for me I have been having to use this (before nodemon):

Code: (SSH/Terminal/CMD)
forever start ~/domains/nova-rpg.com/nrpg_node_server/app.js

I tried just doing app.js and it said it couldn't find it (go figure).