The easiest way to execute Jenkins is through the built in Jetty servlet container. You can execute Jenkins like this:
Of course, you probably want to send the output of Jenkins to a log file, and if you're on Unix, you probably want to use nohup:
To see Jenkins, simply bring up a web browser and go to URL http://myServer:8080 where myServer is the name of the system running Jenkins.
Jenkins normally starts up using port 8080. However, if you have other web services starting up you might find that this port is already taken. You can specify a different port by using --httpPort=$HTTP_PORT where $HTTP_PORT is the port you want Jenkins to run on. Other command line parameters include:
Jenkins passes all (or just leading parameters until the first Jenkins-specific parameter?) command line parameters to the Winstone servlet container, so you can get more information by looking at the Winstone Command Line Parameter Reference
Using HTTPS with an existing certificate
If you're setting up Jenkins using the built-in Winstone server and want to use an existing certificate for HTTPS:
The keystore should be in JKS format (as created by the JDK 'keytool') and the keystore and target key must have the same password. (Placing the keystore arguments after Jenkins-specific parameters does not seem to work; either they are not forwarded to Winstone or Winstone ignores them coming after unknown parameters. So, make sure they are adjacent to the working --httpsPort argument.)
If your keystore contains multiple certificates (e.g. you are using CA signed certificate) Jenkins might end-up using a incorrect one. In this case you can convert the keystore to PEM and use following command line options:
Passing the Command Line Parameters to an instance on a Mac OSX (Currently is Mavericks 10.9.4) that uses launchctl (rather than using Jenkins.jar to start up)
In this example, we set the Jenkins server to listen for HTTPS on port 8443. Not we do not disable the httpPort by passing in -1. So in this example, your server would answer on both http and https. We also assume that the user has already created the keystore (see the "Using SSL" section from http://wiki.wocommunity.org/display/documentation/Installing+and+Configuring+Jenkins)
Creating a certificate for use within Jenkins. This used a stock Jenkins 1.612 installation on Windows Server 2008 R2 Standard 64-bit. This creates a certificate signed by a Certificate Authority such as Digicert, if making your own certificate skip steps 3, 4, and 5.
This process utilizes Java's keytool, however you do not have to perform a separate Java installation if you don't need it. Jenkins packages a JRE with it when you do the installation, locasted in C:\Program Files (x86)\Jenkins\jre\bin
Step 1: Create a new keystore on your server. This will place a 'keystore' file in your current directory.
Step 2: Verify the keystore was created (your fingerprint will vary)
Step 3: Create the certificate request. This will create a 'certreq.csr' file in your current directory.
Step 4: Use the contents of the 'certreq.csr' file to generate a certificate from your certificate provider. Request a SHA-1 certificate (SHA-2 is untested but will likely work). If using DigiCert, download the resulting certificate as Other format "a .p7b bundle of all the certs in a .p7b file"
Step 5: Add the resulting .p7b into the keystore you created above.
Step 6: Copy the 'keystore' file to your Jenkins secrets directory. On a stock installation, this will be at
Step 7: Modify the <arguments> section of your C:\Program Files (x86)\Jenkins\jenkins.xml file to reflect the new certificate. Note: This example disables http via httpPort=-1 and places the server on 8443 via httpsPort=8443
Step 8: Restart the jenkins service to initialize the new configuration.
Step 9: After 30-60 seconds, Jenkins will have completed the startup process and you should be able to access the website at https://server-name.your.company.com:8443; Verify the certificate looks good via your browser's tools. If the service terminates immediately, there's an error somewhere in your configuration. Useful error information can be found in:
Skip to end of metadata Go to start of metadata