0、说明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
1、环境 OS: CentOS-7-x86_64-Minimal Java JDK:1.8 Maven: 3.0.5 Gradle: 3.1 Tomcat: 9.0.8 Jenkins: 1.658 2、安装使用软件包下载地址如下: JDK: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html Maven: http://mirror.bit.edu.cn/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz Gradle: https://downloads.gradle.org/distributions/gradle-3.1-all.zip Tomcat: http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.8/bin/apache-tomcat-9.0.8.tar.gz Jenkins: https://codeload.github.com/jenkinsci/jenkins/tar.gz/jenkins-1.658 3、本次Jenkins安装为测试环境,为了模拟公司Jenkins从低版本升级使用 jenkins 1.658版本在启动tomcat后首次访问时不需要任何配置(不需要设置管理用户和密码)便可直接进行任何操作,后续设置管理用户等安全配置请看后续文章 |
1、环境配置
1.1、关闭防火墙和SELinux
1 2 3 4 5 |
[root@imzcy ~]# systemctl stop firewalld [root@imzcy ~]# systemctl disable firewalld [root@imzcy ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config [root@imzcy ~]# setenforce 0 |
1.2、配置jdk
1 2 3 4 5 6 7 8 9 10 |
[root@imzcy ~]# tar zxvf jdk-8u171-linux-x64.tar.gz -C /usr/local/ [root@imzcy ~]# ln -s /usr/local/jdk1.8.0_171/ /usr/local/java [root@imzcy ~]# vi /etc/profile export JAVA_HOME=/usr/local/java export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin [root@imzcy ~]# source /etc/profile [root@imzcy ~]# java -version |
1.3、配置maven
1 2 3 4 5 6 7 8 9 |
[root@imzcy ~]# tar zxvf apache-maven-3.0.5-bin.tar.gz -C /usr/local/ [root@imzcy ~]# ln -s /usr/local/apache-maven-3.0.5/ /usr/local/maven [root@imzcy ~]# vim /etc/profile export MAVEN_HOME=/usr/local/maven export PATH=$PATH:${MAVEN_HOME}/bin [root@imzcy ~]# source /etc/profile [root@imzcy ~]# mvn -v |
1.4、配置gradle
1 2 3 4 5 6 7 8 9 |
[root@imzcy ~]# unzip gradle-3.1-all.zip -d /usr/local/ [root@imzcy ~]# ln -s /usr/local/gradle-3.1/ /usr/local/gradle [root@imzcy ~]# vi /etc/profile export GRADLE_HOME=/usr/local/gradle export PATH=$PATH:${GRADLE_HOME}/bin [root@imzcy ~]# source /etc/profile [root@imzcy ~]# gradle -v |
2、配置tomcat,启动jenkins
2.1、配置tomcat
1 2 |
[root@imzcy ~]# tar zxvf apache-tomcat-9.0.8.tar.gz -C /usr/local/ [root@imzcy ~]# ln -s /usr/local/apache-tomcat-9.0.8/ /usr/local/tomcat |
2.2、将jenkins.war包放到tomcat的webapp目录下,并启动tomcat
1 2 3 4 5 6 7 8 9 10 11 |
#2.2.1、将jenkins.war包复制到tomcat的webapp目录下,并启动tomcat [root@imzcy ~]# cp jenkins.war /usr/local/tomcat/webapps/ [root@imzcy ~]# cd /usr/local/tomcat/bin/ [root@imzcy bin]# ./startup.sh //tomcat启动时候会自动解压webapp目录下的war包为单独目录 #2.2.2、检查tomcat的启动日志文件和端口监听状态是否有异常 [root@imzcy ~]# cd /usr/local/tomcat/logs [root@imzcy logs]# more catalina.out [root@imzcy ~]# netstat -ant |
3、使用ip+端口号+目录方式访问jenkins
1 |
http://192.168.43.213:8080/jenkins |