This guide is helpful in registering windows binary as service.
To execute vREST Enterprise server as service, please follow the steps below:
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 |
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 |
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 |
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> |
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.