Home > Article > Operation and Maintenance > Jenkins installation tutorial on linux server (picture)
Jenkins is an open source continuous integration tool written in java and is currently widely used by companies at home and abroad. This chapter teaches you how to install Jenkins on the linux server.
Jenkins is an open source continuous integration tool written in java and is currently widely used by companies at home and abroad. This chapter teaches you how to install Jenkins on a Linux server.
1. Obtain a linux server
To install git under linux, you must first have a linux server. As a novice , the machines on hand must all be Windows, and installing a virtual machine is simply torture for a novice like me; the simplest way to obtain a Linux server here is to rent one from Alibaba Cloud. Select CentOS7.3 64-bit as the image.
2. Install jdk
The operation of Jenkins requires jdk, so we must install jdk before installing Jenkins . Students who have no installation experience can refer to my other tutorial on installing jdk on a Linux server. Portal: Install jdk on the linux server
3. Install Jenkins with yum
It is recommended to use yum to install Jenkins, which is the simplest and most convenient.
There is no Jenkins in yum repos by default. You need to add the Jenkins repository to yum repos first.
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
yum installation Jenkins
yum install jenkins
Then you can see that the system starts to download and install automatically.
When prompted whether to download, enter y and press Enter.
Wait patiently for the installation to complete.
#Now Jenkins has been installed, but it is best to modify the configuration slightly before starting it. By default, Jenkins is started using the Jenkins user, but this user is not currently granted permissions by the system. Here we change the startup user to root. In addition, the default port of Jenkins is 8080, which conflicts with the default port of tomcat. We also modify the default port. port.
Enter the command to enter the Jenkins configuration file
vi /etc/sysconfig/jenkins
It is easy to find in the configuration file
Modify the configuration here
JENKINS_USER="root" JENKINS_PORT="8081"
After modifying the configuration, saveExit.
Okay, now the configuration file has been modified and Jenkins can be started.
Enter the startup command to start the Jenkins service.
service jenkins start
OK indicates that Jenkins started successfully.
Enter ip:8081 in the browser to enter the Jenkins login page.
After entering the login page, Jenkins prompts us to enter the super administrator password to unlock. According to the prompts, we can find the password in the /var/lib/jenkins/secrets/initialAdminPassword file.
Enter the command to find the password.
tail /var/lib/jenkins/secrets/initialAdminPassword
After finding the password, copy the password, paste it into the Jenkins unlock page, and click Continue to continue the initialization configuration. After a short wait, you will enter the plug-in installation page.
Here we click Install suggested plugins to install the default plugins. Of course, you can also click another button to install the specified plugins.
After clicking, the page enters the plug-in download and installation page.
Wait patiently for all installations to be completed. After the installation is completed, the page automatically enters the administrator accountRegistration page.
#This page must be familiar to everyone, please enter your information to register. After entering the information, click Save and Finish.
Click Start using Jenkins to enter the main Jenkins page.
The above is the detailed content of Jenkins installation tutorial on linux server (picture). For more information, please follow other related articles on the PHP Chinese website!