Enabling Node.JS (Linux Cloud/Shared plans)

Our Mocha, and WordPress Premium + Advanced packages offer support for NodeJS (Any accounts purchased since January of 2018).

Integrate NodeJS application

Its easy to integrate NodeJS application to a web server via .htaccess. You should replace PORT with the port on which your NodeJS application listens.

  1. Login to the Cpanel.

  1. Choose the File Manager.

  1. Edit your .htaccess file.

  1. Add the following lines and click Save:

RewriteEngine On RewriteRule ^$ https://127.0.0.1:PORT/ [P,L] RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule ^(.*)$ https://127.0.0.1:PORT/$1 [P,L]

  • Unused port should be selected for NodeJS application (Recommended RANGE: 40000 - 65535)
  • The .htaccess files can be created under every domain/sub-domain or folder
  • If the NodeJS application fails to start, select a new port from the above range
  • Each NodeJS application listens on its own port which is configured in the code

PS: Currently this functionality is available for our Mocha + WP Premium/Advanced plans purchased since January of 2018.