The quick_start directory of the HOOPS Communicator package contains the start_server script that will start a HOOPS Server using common settings and a bundled version of the NodeJS runtime. The bundled configuration is designed to work for most users out of the box. This guide moves beyond to provide insights on how to run the server in a variety of ways that provide greater control and monitoring capabilities.
This section assumes that you are using a system installed version of NodeJS and npm.
Starting the HOOPS Server Manually
To get things started, first navigate to the appropriate directory in your installation and ensure all node dependencies have been installed:
The server is now ready to start:
You can modify the start script in package.json to include a configuration file of your choice using the --config-file command-line option.
Running as a Background Process
It can be useful to run the HOOPS Server as a background process with the use of a process manager tool. These tools provide easy ways to monitor, aggregate, and restart applications in the event of a crash. There are a variety of options available to accomplish this task depending on your needs and environment.
When running the HOOPS Server with a process manager tool, it is recommended to use absolute paths for configuration file values.
Cross-Platform with PM2
The PM2 Process Manager is a production-grade process manager for NodeJS applications. It provides a consistent cross-platform API for monitoring and restarting processes in the event of a failure.
After installing PM2 globally we can start HOOPS Server with the following command:
Additionally, PM2 is capable of starting processes when the system boots. Refer to the Startup Script section of the PM2 documentation for detailed information.
Running as a Daemon on Linux
Systemd is available on most linux distributions and can be used to run HOOPS Communicator in the background. Begin by creating a file named communicator.service with the following content:
You will need to set the values between the < > to be relevant to your system. Once you have created the file, move it into the correct systemd folder:
You can now start the server by running:
Likewise, you can stop the server:
You can also view the server log: