1,JenKines简单介绍--图解

JenKins 环境搭建 for Centos6.5_nginx

2,pre-install

Jdk+Tomcat(可选择不装用自带的jetty)

为了解决可能出现的 OutOfMemoryError: PermGen space 问题,需要修改一下$TOMCAT_HOME/bin/catalina.sh 文件,添加一句

JAVA_OPTS="-Xms512m -Xmx768m -XX:MaxNewSize=256m -XX:MaxPermSize=128m"

3,最新项目war下载地址(截止到2015-03-05)

wget http://mirror.xmission.com/jenkins/war/1.601/jenkins.war

JenKins 环境搭建 for Centos6.5_tomcat_02JenKins 环境搭建 for Centos6.5_nginx_03

http://mirrors.jenkins-ci.org/

View Code

4,访问测试

JenKins 环境搭建 for Centos6.5_反向代理_04

5,使用nginx 做反向代理

wget http://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.6.2-1.el6.ngx.x86_64.rpm

rpm -ivh nginx*

新建一个配置文件 /etc/nginx/conf.d/jenkins.conf 内容如下(注释掉的两行是打印日志用的,一般情况下不用打开):


server {
listen 80;
server_name ruiy.org;
#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://localhost: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;
}
}


现在启动 Nginx


# service nginx start


我们先修改一下本机的 hosts 文件(C:\Windows\System32\drivers\etc\hosts)添加:

JenKins 环境搭建 for Centos6.5_反向代理_05

使用nginx 代理访问

JenKins 环境搭建 for Centos6.5_nginx_06

New Projects

JenKins 环境搭建 for Centos6.5_反向代理_07