ubuntu16.04 安装jenkins
1.先安装JAVA JDK
1.1 检查是否安装jdk
java -version
有安装则跳过
无安装则先安装jdk
安装方式点击查看
ps 我选择安装jdk为:sudo apt-get install openjdk-8-jdk
2.安装jenkins
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins
ps: 安装后会出现大量dbkg依赖包错误
2.1 解决dpkg依赖包错误
1.$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名 2.$ sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹 3.$ sudo apt-get update, apt-get -f install 4.$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old // 5.$ sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉 6.$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字
查看是否安装成功systemctl status jenkins.service
cat /etc/services | grep 8080
#查看8080端口是否开启成功
2.1 修改jenkins 端口号
vim /etc/default/jenkins
# port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8080 修改为: # port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8089
2.2 启动命令
sudo service jenkins start sudo service jenkins stop 或者 sudo systemctl start jenkins sudo systemctl stop jenkins
2.3 其他说明
安装路径:/var/lib/jenkins
日志路径:/var/log/jenkins/jenkins.log
3.启动jenkins
http://ip:8089
根据提示 获取初始密码sudo cat /var/lib/jenkins/secrets/initialAdminPassword
最后根据提示完成安装
ps:可以配置nginx 来实现反向代理 这样比较安全
相关推荐
yserver 2020-08-15
达观数据 2020-11-11
汪康 2020-10-30
ppppfly 2020-10-24
synshitou 2020-10-21
programmeryu 2020-09-24
Topbeyond 2020-08-21
lrcoop 2020-08-18
young依然 2020-08-17
oden 2020-08-16
lrcoop 2020-08-15
王永迪 2020-08-15
pursuemylife 2020-08-14
pandaphinex 2020-08-09
leonranri 2020-07-26
CloasGao 2020-07-21
zccheu 2020-07-18