Prerequisites : Machine running CentOS 7 and tomcat installed on it. Please find instructions to install tomcat on CentOS 7 here.
-
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
-
Download jenkins.war file from internet
wget https://updates.jenkins-ci.org/download/war/2.45/jenkins.war
- Remove all the files from tomcat_home_directory/webapss folder
rm -rf /opt/tomcat/webapps/*.*
- 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