Skip to content

Instantly share code, notes, and snippets.

@swarupdonepudi
Last active February 28, 2017 19:31
Show Gist options
  • Save swarupdonepudi/6ee16e9ae402b3f9372ad1374e10edd0 to your computer and use it in GitHub Desktop.
Save swarupdonepudi/6ee16e9ae402b3f9372ad1374e10edd0 to your computer and use it in GitHub Desktop.
Installation instructions for jenkins running on tomcat on CentOS 7

Prerequisites : Machine running CentOS 7 and tomcat installed on it. Please find instructions to install tomcat on CentOS 7 here.

  1. set two environment variables: "JAVA_HOME" and "JRE_HOME"

    sudo cp /etc/profile /etc/profile_backup
     echo 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk' | sudo tee -a /etc/profile
     echo 'export JRE_HOME=/usr/lib/jvm/jre' | sudo tee -a /etc/profile
     source /etc/profile
  2. Download jenkins.war file from internet

wget https://updates.jenkins-ci.org/download/war/2.45/jenkins.war
  1. Remove all the files from tomcat_home_directory/webapss folder
rm -rf /opt/tomcat/webapps/*.*
  1. Copy the downloaded Jenkins.war file to /opt/tomcat/webapps as ROOT.war
cp ./jenkins.war /opt/tomcat/webapps/ROOT.war

Jenkins installation is Complete

You can verify that this installation is successful by accessing the URL from the browser on your host machine.

http://Your_VM_IP _Adress:8080/

Open /opt/tomcat/.jenkins/secrets/initialAdminPassword file to get admin password

cat /opt/tomcat/.jenkins/secrets/initialAdminPassword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment