For Linux via systemd
To execute vREST Enterprise server as service, please follow the steps below:
Create a file named vrest.service with the following content
[Unit] Description=vREST - An automated REST API Testing Tool After=network.target [Service] ExecStart=</path/to/vrest/binary/file> Restart=always User=<USER_NAME> Group=<GROUP_NAME> Environment=PATH=/usr/bin:/usr/local/bin WorkingDirectory=</path/to/vrest/binary/directory> [Install] WantedBy=multi-user.target
In the above file, replace the following paths:
</path/to/vrest/binary/file>
Replace it with absolute path of vREST enterprise binary file. Please change the file name from vrest_linux_x_x_x to vrest_linux, so that you don't have to change the service whenever you want to upgrade / downgrade vREST Enterprise server.
<USER_NAME>
Replace it with the user, by which you want to execute vREST Enterprise server.
<GROUP_NAME>
Replace it with the group name.
</path/to/vrest/binary/directory>
Replace it with absolute path of the directory where vREST enterprise binary file resides. vREST's config.json file should also exist in this directory.
Now execute the following commands:
// Copy your service file into the /etc/systemd/system $ mv vrest.service /etc/systemd/system // Tell systemd about the new service with $ systemctl daemon-reload // Start vrest service $ systemctl start vrest // Enable vrest service to run on boot $ systemctl enable vrest //See logs with $ journalctl -u vrest
- That's it.
Note:
- Before starting vREST, please ensure that MongoDB server is ready to accept database connections. So,
- If you are running MongoDB on separate machine, then please ensure that MongoDB server is running before starting the vREST application.
or if you are running MongoDB on the same machine as vREST application, then you must run vrest.service after mongod.service as follows:
[Unit] Description=vREST - An automated REST API Testing Tool After=network.target mongod.service [Service] ExecStart=</path/to/vrest/binary/file> Restart=always User=<USER_NAME> Group=<GROUP_NAME> Environment=PATH=/usr/bin:/usr/local/bin WorkingDirectory=</path/to/vrest/binary/directory> [Install] WantedBy=multi-user.target
And you must update the mongod.service by following this link.