Home  >  Article  >  Operation and Maintenance  >  How to install Jenkins on Linux

How to install Jenkins on Linux

王林
王林forward
2023-05-16 08:28:191848browse

Linux installation Jenkins

Git installation is very simple

yum install git
git --version

Maven can be downloaded and configured with environment variables

下载:wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
配置环境变量
export M2_HOME=/data/opt/maven/maven-3.8.6
export PATH=$PATH:$M2_HOME/bin

JDk requires Java 8 or above, and the latest version should require Java 11 or above .

After we are ready, we officially enter the deployment of Jenkins.

1. Download and install

wget --no-check-certificate  http://pkg.jenkins-ci.org/redhat-stable/jenkins-2.190.3-1.1.noarch.rpm
rpm -ivh jenkins-2.190.3-1.1.noarch.rpm

If the speed is slow, you can download it locally and then transfer it to the server.

2. Modify the port configuration

vi /etc/sysconfig/jenkins
# 修改端口号为 8880
## Type:        integer(0:65535)
## Default:     8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8880"

3. Start

systemctl start jenkins
systemctl status jenkins

How to install Jenkins on Linux

4. Solve the problem of slow loading of the homepage

When we visit for the first time, the following interface will be prompted, and the waiting time will be long.

How to install Jenkins on Linux

Change to the Tsinghua University image and then restart Jenkins

find / -name *.UpdateCenter.xml
vi /var/lib/jenkins/hudson.model.UpdateCenter.xml
# 改为以下地址 
#https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
<?xml version=&#39;1.1&#39; encoding=&#39;UTF-8&#39;?>
<sites>
  <site>
    <id>default</id>
    <url>https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json</url>
  </site>
</sites>

5. Install the plug-in

Enter Jenkins and you need to follow the prompts to open the log file Get the password without going into details.

Choose to install some plug-ins. Due to network reasons, there is a high probability that the installation will fail, so you only need to check the last Chinese plug-in.

How to install Jenkins on Linux

6. Set up the administrator user

Set the user name and password as the administrator user, or you can use admin directly.

The above is the detailed content of How to install Jenkins on Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete