# 安装openjdk11
apt update
sudo apt install -y openjdk-11-jdk
# 导入jenkins key
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
# 添加jenkins软件源
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
# 安装jenkins
sudo apt update
sudo apt install jenkins
查看服务
systemctl status jenkins
查看jenkins默认密码并修改
cat /var/lib/jenkins/secrets/initialAdminPassword
我想使用80端口访问jenkins,只能安装jenkins
apt install nginx
修改nginx配置文件
vim /etc/nginx/conf.d/jenkins.conf
upstream backend {
server 10.168.1.2:8080 weight=1;
}
server {
listen 80;
server_name jenkins.cnbugs.eu.org;
location / {
proxy_pass http://backend;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
重启nginx
systemctl restart nginx
访问http://jenkins.cnbugs.eu.org 访问jenkins,安装推荐的插件即可。
文档更新时间: 2023-03-09 09:31 作者:admin