For Windows

This guide is helpful in registering windows binary as service.

Prerequisites:

  1. MongoDB is installed and running
    1. If you have installed mongodb on the same machine, then create service for MongoDB as well. Please use the link below to configure MongoDB server as service on Windows.
      https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#configure-a-windows-service-for-mongodb-community-edition
      W
      e will add dependency to this service in vREST service.

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

  1. First create a directory of your choice, say "vrest" where you will store all the vREST related files. To create a directory, execute the commands below:

    > cd /go/to/some/path
    > mkdir vrest
    > cd vrest
  2. Now download vREST enterprise and move it into the directory created above. After that rename vREST Enterprise binary like below:

    > move vrest_win_x_x_x.exe vrest_enterprise.exe
  3. Now, setup vREST enterprise server configuration file `config.json` by following our Quick Installation Guide (Step 2 of this link).
  4. Now download a third party tool winsw (Download winsw) which will create the windows service for us. And move this winsw.exe file to the directory created in step 1. And after that rename winsw.exe like below:

    > move winsw.exe vrest.exe
  5. Now, create a file `vrest.xml` with the following content:

    <configuration>
      <id>vrest</id>
      <name>vREST</name>
      <description>This service runs vREST application to automate your REST API Testing.</description>
      <executable>%BASE%\vrest_enterprise.exe</executable>
      <logmode>roll</logmode>
      <logpath>%BASE%\logs</logpath>
      <depend>MongoDB</depend>
      <onfailure action="restart" delay="10 sec"/>
      <onfailure action="restart" delay="10 sec"/>
      <workingdirectory>%BASE%</workingdirectory>
      <startmode>Automatic</startmode>
      <priority>normal</priority>
    </configuration>

    Note: If you have installed MongoDB on different machine then remove the below line from the above file `vrest.xml`:

      <depend>MongoDB</depend>
  6. Now open Application `Command Prompt` with `Run as Administrator` and go to the directory created in step 1 and execute the following command:

    > vrest.exe install

    Note: the above command will register vrest enterprise binary as service in windows services which will be automatically start on boot and on failure, it will retry to restart the vREST server two times with in an interval of 10 seconds.

  7. Now vREST Enterprise server is registered as service in Windows services. Just go to Windows services and look for vrest service, then you may start vREST service by clicking on start link available in left hand side. For detailed information on starting/stopping windows service, please visit this third party link. 

Â