操作系统:CentOS Linux release 7.5.1804 (Core)
安装步骤:
1.下载jenkins.war包到本地
# wget http://mirrors.jenkins.io/war-stable/1.651.2/jenkins.war
2.下载jdk-7u25-linux-x64.tar.gz到本地并安装
# tar -xzf jdk-7u25-linux-x64.tar.gz
# mkdir -p /usr/java
# mv jdk1.7.0_25/ /usr/java
3.配置JAVA环境变量,在/etc/profile末尾追加配置
export JAVA_HOME=/usr/java/jdk1.7.0_25
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
4. 加载环境变量,确认配置生效
# source /etc/profile
# java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
5.下载tomcat并安装
# wget https://archive.apache.org/dist/tomcat/tomcat-6/v6.0.53/bin/apache-tomcat-6.0.53.tar.gz
# tar zxf apache-tomcat-6.0.53.tar.gz
# mv apache-tomcat-6.0.53 /usr/local/tomcat
6.将jenkins.war复制到tomcat默认发布的目录下,使用jar解压,并启动tomcat
rm -rf /usr/local/tomcat/webapps/ROOT
cp /usr/local/src/jenkins.war /usr/local/tomcat/webapps/ROOT/jenkins.war
# jar -xvf jenkins.war
# sh /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.7.0_25
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
7.通过浏览器成功访问