Windows Service Wrapper
Intro
The Win32 Wrapper, Makes Jetty Running as a Windows NT Service Possible.
The Win32Wrapper makes use of Java Service Wrapper, see http://wrapper.tanukisoftware.org
Quick Start Guide
installing jetty as windows service
| Code Block |
|---|
(in your <jetty-root>/bin)
Jetty-Service.exe --install jetty-service.conf
or
Jetty-Service.exe -i jetty-service.conf
|
Starting jetty as windows service
| Code Block |
|---|
(in your <jetty-root>/bin)
Jetty-Service.exe --start jetty-service.conf
or
Jetty-Service.exe -t jetty-service.conf
|
Stopping jetty as windows service
| Code Block |
|---|
(in your <jetty-root>/bin)
Jetty-Service.exe --stop jetty-service.conf
or
Jetty-Service.exe -p jetty-service.conf
|
Removing jetty as windows service
| Code Block |
|---|
(in your <jetty-root>/bin)
Jetty-Service.exe --remove jetty-service.conf
or
Jetty-Service.exe -r jetty-service.conf
|
Note: The above application (Jetty-Service.exe) must execute with administrator rights otherwise, it fails.
In Vista, even with administrator account the service fails to install. Giving an error 'OpenSCManager failed'.
Below is the solution to this problem. This will now open a command prompt window with administrator rights.
| Code Block |
|---|
Go to Start | All Programs | Accessories, then right-click on "Command Prompt", and select "Run as administrator".
|
Configuring Windows Service Wrapper
Setting a Jetty Configuration XML
Setting a Jetty Configuration XML for Windows Service Wrapper can be done by editing jetty-service.conf found in your <jetty-root>/bin
change the
| Code Block |
|---|
...
wrapper.app.parameter.1=../etc/jetty.xml
...
|
to any jetty xml configuration of your choice
Example:
| Code Block |
|---|
...
wrapper.app.parameter.1=../etc/jetty-ajp.xml
...
|
you can also set multiple jetty configuration XMLs, Just add a new line of configuration code, following the pattern below:
| Code Block |
|---|
wrapper.app.parameter.<parameter number>=<jetty xml configuration path>
|
Example:
| Code Block |
|---|
...
wrapper.app.parameter.1=../etc/jetty.xml
wrapper.app.parameter.2=../etc/jetty-plus.xml
wrapper.app.parameter.3=../etc/jetty-ajp.xml
...
|