설치

wget -O /etc/yum.repos.d/jenkins.repo <https://pkg.jenkins.io/redhat-stable/jenkins.repo>
rpm --import <https://pkg.jenkins.io/redhat-stable/jenkins.io.key>
yum install jenkins
 
vi /etc/init.d/jenkins
PARAMS="--logfile=/data/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war --daemon"
# 로그 디렉토리 변경이 필요하다면 수정, 필요하지 않다면 패스해도 된다
 
chown -R root.root /var/lib/jenkins
chown -R root.root /data/log/jenkins
chown -R root.root /var/cache/jenkins/
 
vim /etc/sysconfig/jenkins
# USER명만 수정한 뒤 저장, Port도 필요하면 같이 수정
JENKINS_USER = 'root'
JENKINS_PORT="9090"
 
systemctl start jenkins.service
# 항상 실행할 수 있도록 세팅
 
service jenkins start
service jenkins stop
service jenkins restart