介紹
Win32 Wrapper, 讓Jetty以Windows NT 服務運行成為可能。
Win32Wrapper利用的是Java Service Wrapper, 請參看 http://wrapper.tanukisoftware.org
安裝成服務(in your /bin)
Jetty-Service.exe --install jetty-service.conf
或者
Jetty-Service.exe -i jetty-service.conf
以服務啟動Jetty(in your /bin)
Jetty-Service.exe --start jetty-service.conf
或者
Jetty-Service.exe -t jetty-service.conf
以服務停止Jetty
(in your /bin)
Jetty-Service.exe --stop jetty-service.conf
或者
Jetty-Service.exe -p jetty-service.conf
刪除服務Jetty(in your /bin)
Jetty-Service.exe --remove jetty-service.conf
或者
Jetty-Service.exe -r jetty-service.conf
注意:上面的應用程式Jetty-Service.exe必須以系統管理員身份執行,否則會失敗。在Vista,即使是系統管理員安裝也會失敗。出現錯誤'OpenSCManager failed'。下面是這個檔案的解決方案。這個會以管理員權限開啟一個命令視窗。
開始 | 所有程式 | 附件, 然後右鍵點擊"命令提示字元", 選擇"以系統管理員身份運行"。 配置Jetty服務
通過編輯/bin路徑下的jetty-service.conf檔案:
...
wrapper.app.parameter.1=../etc/jetty.xml
...
你可以選擇其它的jetty xml設定檔
例如:
...
wrapper.app.parameter.1=../etc/jetty-ajp.xml
...
你也可以通過如下格式指定多個設定檔:
wrapper.app.parameter.<parameter number>=<jetty xml configuration path>
例如:
...
wrapper.app.parameter.1=../etc/jetty.xml
wrapper.app.parameter.2=../etc/jetty-plus.xml
wrapper.app.parameter.3=../etc/jetty-ajp.xml
...