Install Jenkins on centos7

Install Jenkins on centos7#

installation##

Add yum repos, then install

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins

If there is no java, install java

sudo yum install java

Start and stop##

sudo service jenkins start/stop/restart
sudo chkconfig jenkins on

Default settings of jenkins##

Turn on and turn off the firewall##

firewall-cmd --zone=public--add-port=8080/tcp --permanent
firewall-cmd --zone=public--add-service=http --permanent
firewall-cmd --reload
firewall-cmd --list-all

About java on centos

Jenkins does not support working on the default jdk of centos. If it looks like this, you need to remove:

java -version
java version "1.5.0"gij(GNU libgcj) version 4.4.620110731(Red Hat 4.4.6-3)

In order to use Jenkins correctly:

yum remove java

Then you can install openjdk

yum install java-1.7.0-openjdk

The correct is as follows:

java -version
java version "1.7.0_79"
OpenJDK Runtime Environment(rhel-2.5.5.1.el6_6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM(build 24.79-b02, mixed mode)

Configure Port##

Modify /etc/sysconfig/jenkins:

JENKINS_PORT="8080"

Configure java path##

Start directly:

sudo service jenkins start

But found that the startup failed, so you need to configure the java location:

vi /etc/init.d/jenkins

Join the native java at startup:

[ root@iZ94xvn71eeZ ~]# vim /etc/init.d/jenkins 

# Set up environment accordingly to the configuration settings
[- n "$JENKINS_HOME"]||{ echo "JENKINS_HOME not configured in $JENKINS_CONFIG";if["$1"="stop"]; then exit 0;else exit 6; fi;}[-d "$JENKINS_HOME"]||{ echo "JENKINS_HOME directory does not exist: $JENKINS_HOME";if["$1"="stop"]; then exit 0;else exit 1; fi;}

# Search usable Java as/usr/bin/java might not point to minimal version required by Jenkins.
# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
candidates="
/etc/alternatives/java
/usr/lib/jvm/java-1.8.0/bin/java
/usr/lib/jvm/jre-1.8.0/bin/java
/usr/lib/jvm/java-1.7.0/bin/java
/usr/lib/jvm/jre-1.7.0/bin/java
/usr/bin/java
/usr/java/jdk1.7.0_80/bin/java
"

I added the last line above.

Restart, it can run normally.


start up##

The browser enters the ip and port access. The first page is starting. After the start, you will be prompted to enter a string of passwords, and then enter the plug-in installation interface, select the default, then an error will be reported:
An error occurred during installation: Forbidden

Solution:
I "fixed it" by restarting Jenkins http://localhost:8080/restart. Just restart to continue.

reference###

Recommended Posts

Install Jenkins on centos7
How to install Jenkins on CentOS 8
How to install Jenkins on CentOS 8
Install Docker on Centos7
install LNMP on centos7.4
Install Java on Centos 7
Nodejs install on centos7
Install FFmpeg on CentOS 8
Install RabbitMQ on CentOS 7
Install Node.js on Centos
Maven install on centos7
Install MongoDB on CentOS 7
Jenkins build on centos
Install Surelog on CentOS8
Install Jenkins under Centos 7
Openjdk install on centos7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install RabbitMQ on CentOS7
Install Jenkins on linux centos (non-docker way)
Install mysql online on centos
Install ElasticSearch 7.x on CentOS 7
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
CentOS + Jenkins
Install docker on Centos system
install EPEL repo on centos
1.5 Install Centos7
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Install Nginx server on CentOS 7
How to install jdk1.8 on centOS7
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install TensorFlow on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Java on CentOS 8
How to install GCC on CentOS 8
How to install Jenkins on Ubuntu 16.04
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
Install MySQL on Linux CentOS7 (Windows)
How to install Jenkins on Ubuntu 20.04
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Jenkins on Ubuntu 18.04
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
​Install Oracle database on CentOS Linux
How to install Python on CentOS 8