1. installation
https://www.cnblogs.com/mmzs/p/12092982.html
# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
# yum install jenkins
2. configure
vim /etc/sysconfig/jenkins # 暫不做修改
3. start service
# systemctl start jenkins
# systemctl daemon-reload
# systemctl restart jenkins
# systemctl status jenkins
http://localhost:8080/
# 出現 Please wait while Jenkins is getting ready to work...
# 修改:
vim /var/lib/jenkins/hudson.model.UpdateCenter.xml
# <url>http://updates.jenkins.io/update-center.json</url> 將https改爲http
# 其他國內備用地址(也可以選擇使用):
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
http://mirror.esuni.jp/jenkins/updates/update-center.json
# 重啓服務 進行訪問
# 安裝推薦的插件時報錯:安裝過程中出現一個錯誤: No such plugin: cloudbees-fo
# 解決方法: 去 https://updates.jenkins-ci.org/download/plugins/cloudbees-folder/ 下載一個插件:cloudbees-folder.hpi,放入/var/lib/jenkins/plugins
4. 反向代理
server {
listen 83;
server_name localhost;
#access_log /var/log/jenkins_access_log main;
#error_log /var/log/jenkins_error_log debug_http;
client_max_body_size 60M;
client_body_buffer_size 512k;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}