码迷,mamicode.com
首页 > 其他好文 > 详细

centos7部署jenkins

时间:2020-06-03 09:26:51      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:download   echo   code   file   hat   port   col   source   启动   

服务器信息:
centos7.4  8C 8G 50G

部署过程

部署jdk
部署tomcat
部署maven
部署jenkins

安装jdk

下载地址

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

下载包上传到服务器/opt下

执行如下命令

tar -zxvf /opt/jdk-8u191-linux-x64.tar.gz -C /usr/local
echo  ‘export JAVA_HOME=/usr/local/jdk1.8.0_191‘ >> /etc/profile
echo ‘export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/sbin‘ >> /etc/profile
source /etc/profile
java -veriosn

部署tomcat

下载地址

http://tomcat.apache.org/download-80.cgi

下载包上传到服务器/opt下

执行如下命令

tar -xvf /opt/apache-tomcat-9.0.30.tar.gz -C /usr/local
cd /usr/local
mv apache-tomcat-9.0.30 tomcat

修改启动端口,默认8080
vim /usr/local/tomcat/conf/server.xml

69     <Connector port="8087" protocol="HTTP/1.1"
70                connectionTimeout="20000"
71                redirectPort="8443" />

启动服务

/usr/local/tomcat/bin/startup.sh

部署maven

下载地址

https://mirror.bit.edu.cn/apache/maven/maven-3/3.1.1/binaries/

下载包上传到服务器/opt下

执行如下命令

tar -zxvf /opt/apache-maven-3.6.3-bin.tar.gz
mv apache-maven-3.6.3 /usr/local/maven3.6
echo ‘export MAVEN_HOME=/usr/local/maven3.6‘ >> /etc/profile
echo ‘export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin‘ >> /etc/profile
source /etc/profile
mvn -v

部署jenkins

下载地址

pkg.jenkins.io/redhat-stable/

下载包上传到服务器/opt下

执行如下命令

rpm -ivh /opt/jenkins-2.222.3-1.1.noarch.rpm

添加jdk路径

vim /etc/rc.d/init.d/jenkins

 75 /etc/alternatives/java
 76 /usr/lib/jvm/java-1.8.0/bin/java
 77 /usr/lib/jvm/jre-1.8.0/bin/java
 78 /usr/lib/jvm/java-1.7.0/bin/java
 79 /usr/lib/jvm/jre-1.7.0/bin/java
 80 /usr/lib/jvm/java-11.0/bin/java
 81 /usr/lib/jvm/jre-11.0/bin/java
 82 /usr/lib/jvm/java-11-openjdk-amd64
 83 /usr/local/jdk1.8.0_191/bin/java
 84 /usr/bin/java

修改启动端口

vim /etc/sysconfig/jenkins

 56 JENKINS_PORT="8088"

启动服务
systemctl daemon-reload
systemctl restart jenkins
systemctl enable jenkins

centos7部署jenkins

标签:download   echo   code   file   hat   port   col   source   启动   

原文地址:https://blog.51cto.com/14822589/2500612

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!