User Tools

Site Tools


computer_science:ci:jenkins:installation

Preparations

Requirements

  • OS - CentOS 7 기준
  • JDK - 1.6 이상
  • Web Server
    • Standalone
    • Tomcat + Nginx (or Apache HTTP)

Package Repository

/etc/yum.repo.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

Installation

Standalone

export JENKINS_HOME=/www/jenkins/data
 
java -jar -Djava.awt.headless=true -XX:PermSize=1024M -XX:MaxPermSize=2048M -Xms1024m -Xmx2048m /www/jenkins/war/jenkins.war --httpPort=8888 --webroot=/www/jenkins/web

Web Server

Basic Configuration

  • Domain - ci.kucuny.com (Temporary)
  • Owner - tomcat:tomcat
  • Jenkins Home - /www/jenkins/web
  • Jenkins Data - /www/jenkins/data
  • SSL Certification - /etc/nginx/ssl/(certification_files)

Install Packages

yum install -y java tomcat nginx

Tomcat Configuration

/etc/tomcat/server.xml

<Engine name="Catalina" defaultHost="localhost">
  <Host name="ci.kucuny.com" appBase="/www/jenkins/web" unpackWARs="true" autoDeploy="true">
    <Context path="/" docBase="/www/jenkins/web" />
      <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
        prefix="jenkins_access_log." suffix=".txt"
        pattern="%h %l %u %t &quot;%r&quot; %s %b" />
  </Host>
</Engine>

/etc/tomcat/tomcat.conf (JENKINS_HOME)

CATALINA_OPTS="-DJENKINS_HOME=/www/jenkins/data -XX:PermSize=1024M -XX:MaxPermSize=2048M -Xms1024m -Xmx2048m"

Nginx Configuration

server {
  listen 80;
  return 301 https://$host$request_uri;
}

server {
  listen 443;
  server_name ci.kucuny.com;
  root /www/jenkins/web;
  ssl on;
  ssl_certificate /etc/nginx/ssl/STAR.kucuny.com.crt;
  ssl_certificate_key /etc/nginx/ssl/STAR.kucuny.com.key;
  access_log /var/log/nginx/jenkins.access.log;
  error_log /var/log/nginx/jenkins.error.log;
  location / {
    proxy_pass              http://localhost:8080;
    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_set_header        X-Forwarded-Proto $scheme;
    proxy_redirect          http:// https://;
  }
}

Service enable and start

# Enable tomcat service
systemctl enable tomcat.service
# Enable nginx Service
systemctl enable nginx.service
 
# Start tomcat service
systemctl start tomcat.service
# Start nginx service
systemctl start nginx.service

Connect

computer_science/ci/jenkins/installation.txt · Last modified: 2015/03/19 10:36 by kucuny