1、官网:
https://jenkins.io/
官网的说明一定是最正确、最完整的,
2、更新yum源并下载jenkins:
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
3、Jenkins 文件配置
更改相关内容修改日志
vim /etc/sysconfig/jenkins
JENKINS_HOME="/var/lib/jenkins"
JENKINS_USER="root"
JENKINS_PORT="8080"
# 修改日志等级,避免日志过大或者在Jenkins系统管理---日志管理--修改日志文件为off。
4、nginx文件配置
server {
listen 80;
server_name jenkins.blkid.cn;
location /{
proxy_pass http://127.0.0.1:8091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
5、nginx重载
nginx -s reload
systemctl status nginx
启动jenkins
service jenkins start
systemctl start jenkins
6、配置hosts,浏览器访问
http://jenkins.blkid.cn/