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

How to install Jenkins on Linux

王林
Release: 2023-05-16 08:28:19
forward
1877 people have browsed it

Linux installation Jenkins

Git installation is very simple

yum install git
git --version
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login
## Type:        integer(0:65535)
## Default:     8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8880"
Copy after login

3. Start

systemctl start jenkins
systemctl status jenkins
Copy after login

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
Copy after login
<?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>
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template