Tags:Jenkins
Category: DevOps
how to install Jenkins in Linux Server( use yum to install)
- add Jenkin repo in yum
// bash
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
- Install Jenkins in yum
//bash
yum install Jenkins -y
- Self configure Jenkins
// bash modify jenkins config file
vi /etc/sysconfig/jenkins
// modify Jenkins running port
JENKINS_USER="root" // default is jenkins, change to root
JENKINS_PORT="8081" // default is 8080 change it to the port you want to use
- Run Jenkins
// bash
service jenkins start
// other usage
service jenkins restart
service jenkins stop
- Open Jenkins console in browser, input http://yourdomain.com:JENKINS_PORT
the first step is get the admin password from jenkin initial config
//bash
tail /var/lib/jenkins/secrets/initialAdminPassword
- Then install suggested plugins
- create a new admin user of jenkins or just use default admin and skip it
problems you may meet
- Jenkins can not connect to the Internet from server in China.
Solved: change the Jenkins checkUrl in /var/lib/jenkins/updates/default.json
change the connectionCheckUrl from 'http://www.google.com' to any valid website can view in China Then restart Jenkins
//bash
service jenkins restart
- Console get empty webpage after login into Jenkins at the first time you login Solved: input http://yourdomain.com:JENKINS_PORT/restart in browser and login again.