For Linux via systemd

To execute vREST Enterprise server as service, please follow the steps below:

  1. 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:

    1. </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.

    2. <USER_NAME>

      Replace it with the user, by which you want to execute vREST Enterprise server.

    3. <GROUP_NAME>

      Replace it with the group name.

    4. </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.

  2. 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
  3. That's it.

Note:

  1. Before starting vREST, please ensure that MongoDB server is ready to accept database connections. So,
  2. If you are running MongoDB on separate machine, then please ensure that MongoDB server is running before starting the vREST application.
  3. 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.