Using Node.js on a premium shared hosting account
Author: admin admin Reference Number: AA-00416 Views: 4858 Created: 2015-09-23 10:52 Last Updated: 2015-09-23 11:03 0 Rating/ Voters

We have installed node.js and npm onto all shared hosting servers. 


At the point of writing this is

Node version v0.10.40

npm version 1.4.28


These binaries are located in

/usr/bin

making ......

/usr/bin/node

/usr/bin/npm


To use these you will need to contact support to have SSH enabled on your account for node access,  then you can launch node against your node.js code eg

cd /home/myuser/public_html/

/usr/bin/node index.js

This will then start node.

You will then need to use apache's mod_rewrite to proxy port 80 from apache to your local application port, this can be achieved using the following lines in a .htaccess file

RewriteRule ^$ http://127.0.0.1:61000/ [P,L]

replacing 61000 with the port that your node application has created.
Quick Jump Menu