Skip to content

Instantly share code, notes, and snippets.

@int128
Created October 4, 2012 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save int128/3832976 to your computer and use it in GitHub Desktop.
Save int128/3832976 to your computer and use it in GitHub Desktop.
installing Jetty as a Windows service
rem see http://commons.apache.org/daemon/procrun.html
set SERVICE_HOME=c:\hoge
%SERVICE_HOME%\service.exe //IS//Jenkins --DisplayName=Jenkins --StartPath=%SERVICE_HOME% --LogPath=%SERVICE_HOME%\logs --LogLevel=Debug --StdOutput=auto --StdError=auto --StartMode=Java --StopMode=Java --Jvm=auto ++JvmOptions=-jar ++JvmOptions=start.jar
#===========================================================
# Jetty start.jar arguments
# Each line of this file is prepended to the command line
# arguments # of a call to:
# java -jar start.jar [arg...]
#===========================================================
#===========================================================
# If the arguements in this file include JVM arguments
# (eg -Xmx512m) or JVM System properties (eg com.sun.???),
# then these will not take affect unless the --exec
# parameter is included or if the output from --dry-run
# is executed like:
# eval $(java -jar start.jar --dry-run)
#
# Below are some recommended options for Sun's JRE
#-----------------------------------------------------------
# --exec
# -Dorg.apache.jasper.compiler.disablejsr199=true
# -Dcom.sun.management.jmxremote
# -Dorg.eclipse.jetty.util.log.IGNORED=true
# -Dorg.eclipse.jetty.LEVEL=DEBUG
# -Dorg.eclipse.jetty.util.log.stderr.SOURCE=true
# -Xmx2000m
# -Xmn512m
# -verbose:gc
# -XX:+PrintGCDateStamps
# -XX:+PrintGCTimeStamps
# -XX:+PrintGCDetails
# -XX:+PrintTenuringDistribution
# -XX:+PrintCommandLineFlags
# -XX:+DisableExplicitGC
# -XX:+UseConcMarkSweepGC
# -XX:ParallelCMSThreads=2
# -XX:+CMSClassUnloadingEnabled
# -XX:+UseCMSCompactAtFullCollection
# -XX:CMSInitiatingOccupancyFraction=80
#-----------------------------------------------------------
--exec
-Xmx256m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:+UseConcMarkSweepGC
-Djava.io.tmpdir=./work
-Djetty.home=.
-Djetty.host=127.0.0.1
-Djetty.port=18082
-Djetty.ajp13port=18012
-DHUDSON_HOME=./data
#===========================================================
# Start classpath OPTIONS.
# These control what classes are on the classpath
# for a full listing do
# java -jar start.jar --list-options
#-----------------------------------------------------------
#OPTIONS=Server,jsp,jmx,resources,websocket,ext,plus,annotations,jta,jdbc
#-----------------------------------------------------------
OPTIONS=Server,jsp,ajp
#===========================================================
# Configuration files.
# For a full list of available configuration files do
# java -jar start.jar --help
#-----------------------------------------------------------
#etc/jetty-jmx.xml
#etc/jetty.xml
#etc/jetty-hightide.xml
#etc/jetty-ssl.xml
#etc/jetty-requestlog.xml
#etc/jetty-deploy.xml
#etc/jetty-overlay.xml
#etc/jetty-webapps.xml
#etc/jetty-contexts.xml
#etc/jetty-testrealm.xml
#etc/jetty-jaas.xml
#===========================================================
etc/jetty.xml
etc/jetty-ajp.xml
etc/jetty-deploy.xml
etc/jetty-contexts.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment