- Developer Tools
- Root Access
- SSH Access
- A custom virtual host for your application created in Plesk
I'm not going to list every step in detail here. This article assumes basic knowledge of FTP or git. I checkout my application to /var/www/vhosts/:virtual_host/application.
We're going to set up supervisor to pipe stdout and stderr to seperate log files. We need to make sure we've created the appropriate log directories before we do that though. Replace :virtual_host with the host you've created.
We also need a startup script so that supervisor can start up our application.
Now we're ready to configure our node server and make sure that it's reliably running.
- SSH into machine with root access.
- Create a source folder, download, install, and compile node.
Testing the application
At this point, you should be able to run the node binary and test your application.
I use supervisor for managing the node process. The easiest way to install it is by using the pythong setup tools package.
Install setup tools
Now that setup tools is installed, supervisor is very easy to setup.
The manual for supervisor is very straightforward. We create a configuration file. Specifiy our application in the configuration. And set supervisord to start automaticaly.
Test out supervisor by launching supervisord. You can check the status of your application by launching supervisorctl. See the manual for more options. We can now manually start up supervisor so it launches (with our application) on startup. This is useful in the event that your server gets rebooted. To do this, we create an init script:
Now supervisor will start when the server boots up.
The last step is to configure Apache to route non-static requests over to node:
Restart the apache process by typing /etc/init.d/http restart and test your server! Viola!
If you have problems with any of these steps or any questsions feel free to @camwest on twitter.