jenkins the definitive guide

(Jeff_L) #1
...
[Winstone 2011/07/01 20:55:08] - HTTP Listener started: port=8080
[Winstone 2011/07/01 20:55:08] - Winstone Servlet Engine v0.9.10 running:
controlPort=disabled
[Winstone 2011/07/01 20:55:08] - AJP13 Listener started: port=8009

In a Linux environment, the procedure is similar. Note how we start the Jenkins server from with the
“jenkins” user account we created earlier:


john@lambton:~$ sudo su - jenkins
jenkins@lambton:~$ java -jar /usr/local/jeknins/jenkins.war
[Winstone 2011/07/16 02:11:24] - Beginning extraction from war file
[Winstone 2011/07/16 02:11:27] - No webapp classes folder found - /home/jenkins/
.jenkins/war/WEB-INF/classes
jenkins home directory: /home/jenkins/.jenkins
...
[Winstone 2011/07/16 02:11:31] - HTTP Listener started: port=8080
[Winstone 2011/07/16 02:11:31] - AJP13 Listener started: port=8009
[Winstone 2011/07/16 02:11:31] - Winstone Servlet Engine v0.9.10 running:
controlPort=disabled

This will start the embedded servlet engine in the console window. The Jenkins web application will now
be available on port 8080. When you run Jenkins using the embedded server, there is no web application
context, so you access Jenkins directly using the server URL (e.g., http://localhost:8080)..)


To stop Jenkins, just press Ctrl-C.


By default, Jenkins will run on the 8080 port. If this doesn’t suit your environment, you can specify the
port manually, using the --httpPort option:


$ java -jar jenkins.war --httpPort=8081

In a real-world architecture, Jenkins may not be the only web application running on your build server.
Depending on the capacity of your server, Jenkins may have to cohabit with other web applications
or Maven repository managers, for example. If you are running Jenkins along side another application
server, such as Tomcat, Jetty, or GlassFish, you will also need to override the ajp13 port, using the --
ajp13Port option:


$ java -jar jenkins.war --httpPort=8081 --ajp13Port=8010

Some other useful options are:


--prefix
This option lets you define a context path for your Jenkins server. By default Jenkins will run on
the port 8080 with no context path (http://localhost:8080). However, if you use this option, you
can force Jenkins to use whatever context path suits you, for example:
$ java -jar jenkins.war --prefix=jenkins
Free download pdf