# windows server 2012配置jenkins

2 min read
Table of Contents

所需环境:
1.Jenkins安装包msi(当时使用的是2.303.2)
2.JDK(建议使用JDK11,因为上面那个msi安装时是提示支持JAVA8和JAVA11)


💬 回复: Jun (2021-10-14)

配置步骤:
1.设置JDK环境变量
2.双击MSI
3.先会让使用win账户,此时可以创建一个新win账户(最好加入Administrator组),然后点击验证可能会报这个错误:
this account either does not have the privilege logon as a service
如果出现这个错误,可参照这个步骤添加权限

https://blog.csdn.net/clown_silence/article/details/109054403

4.设置8080端口
5.选择JDK路径,这里要选择bin的上层文件夹,如C:\Envs\jdk-11.0.12


💬 回复: Jun (2021-11-23)

如果jenkins的设置页面报一个“反向代理设置有误”,可以参照下面的方法设置

server {
listen 80;
server_name jenkins.jiangjunnan.cn;
location / {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 90;
proxy_redirect http://127.0.0.1:8080 http://jenkins.jiangjunnan.cn;
# Required for new HTTP-based CLI
proxy_http_version 1.1;
proxy_request_buffering off;
}

Comments