介绍
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-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-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-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 --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
...
wrapper.app.parameter.1=../etc/jetty.xml
...
你可以选择其它的jetty xml配置文件
例如:
...
wrapper.app.parameter.1=../etc/jetty-ajp.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
...
wrapper.app.parameter.1=../etc/jetty.xml
wrapper.app.parameter.2=../etc/jetty-plus.xml
wrapper.app.parameter.3=../etc/jetty-ajp.xml
...