Recipe for running Jetty as service on Window

1,244 views
Skip to first unread message

Trond Olsen

unread,
Dec 31, 2010, 5:12:51 AM12/31/10
to Lift
Here's a quick guide for setting Jetty up as a Windows service. It
depends on the Apache Commons Daemon (http://commons.apache.org/daemon/
procrun.html) for installation and configuration.

The following tiny scrips can be used for setting up the service.
After the service is installed, the most convenient way to manage it,
is to start 'Monitor service' which gives you a gui for configuring
any option.

rem Install service
<path-to-commons-daemon>\prunsrv.exe //IS//Lift --DisplayName="Lift" --
Install=<path-to-commons-daemon>\prunsrv.exe --StartMode=jvm

rem Update service
rem - using 64-bit server version of Java
<path-to-commons-daemon>\prunsrv.exe //US//Lift --Jvm="c:\program files
\java\jre6\bin\server\jvm.dll" --
Environment=jetty.port=80;jetty.host=<host-ip> --Classpath=%CLASSPATH
%;<path-to-jetty>\start.jar --StartParams="--daemon" --StopParams="--
stop" --StartClass=org.eclipse.jetty.start.Main --StartPath=<path-to-
jetty> --StopClass=org.eclipse.jetty.start.Main --StopPath=<path-to-
jetty> --LogPath=<path-to-logs>

rem Monitor service
<path-to-commons-daemon>\prunmgr.exe //MS//Lift

rem Uninstall service
<path-to-commons-daemon>\prunsrv.exe //DS//Lift

rem Start service
<path-to-commons-daemon>\prunsrv.exe //TS//Lift

rem Stop service
<path-to-commons-daemon>\prunsrv.exe //SS//Lift

* see http://commons.apache.org/daemon/procrun.html for all scripting
options.

David Pollak

unread,
Jan 1, 2011, 8:22:12 AM1/1/11
to lif...@googlegroups.com
Cool stuff.  Please write a wiki page as well.

Thanks for contributing to the community!


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics
Reply all
Reply to author
Forward
0 new messages