How to install jenkins on CentOS7

来自koorka知识分享
跳转至: 导航搜索
  • Update your CentOS 7 system

yum install epel-release

yum update

  • Install Java

yum install java-1.7.0-openjdk

  • Install Jenkins

wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo

rpm --import http://pkg.jenkins-ci.org/redhat-stable/jenkins-ci.org.key

yum install jenkins

  • Configure Jenkins
vim /etc/sysconfig/jenkins, 修改相关参数:
JENKINS_HOME="/opt/data/jenkins"
JENKINS_PORT="8083"
  • Configure Nginx
   server {
        listen  80;
        server_name jenkins.yfq.com;
        location / {
            proxy_pass  http://192.168.1.253:8083;
            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;
            proxy_max_temp_file_size 0;
            proxy_connect_timeout 90;
            proxy_send_timeout    90;
            proxy_read_timeout    90;
            proxy_buffer_size     4k;
            proxy_buffers 4 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64k;
        }
    }