Skip to content

Deploying ngrest to remote host

Dmitry edited this page Mar 28, 2016 · 1 revision

Annotation

This is manual on how to deploy ngrest to remote host without having development files/sources on it.

Requirements

Your remote host must have the same set of libraries as your localhost, for example you must have Ubuntu 14.04 on remote host and on local host.

If you have a bit newer/older OS version on your remote, this also should work well.

If your remote host has major differences in libraries it's good idea to install chroot environment with the same OS version and libraries as on your remote host.

Prepairing

To deploy ngrest server to remote host you must first have writable location for it.

ssh to your remote host and issue:

sudo mkdir -p /opt/ngrest
sudo chmod -R 755 /opt/ngrest
sudo chown -R $USER /opt/ngrest

This will create /opt/ngrest directory and add your user as owner.

Deploying ngrest server

On your local host start from any directory:

ngrest deploy-server <REMOTE_HOST>

Where <REMOTE_HOST> is IP or hostname of your remote host.

Deploying your project

To deploy your project to remote host start from project directory:

ngrest deploy <REMOTE_HOST>

Starting remote server

Remote management from ngrest command is not yet implemented. To start and stop ngrest server on remote host you must ssh to it.

cd /opt/ngrest/bin
./ngrestserver

To keep ngrest server running when you close ssh connection, you can use screen. Just type screen before cd /opt/ngrest/bin and press Enter twice. After you close ssh connection ngrest server will be still running within screen.

To connect to already started screen use: screen -r. Use Ctrl+C to stop ngrest server.