Installing Jenkins on Red Hat distributions

Source: Internet
Author: User
Tags centos firewall

orginal link:https://wiki.jenkins-ci.org/display/jenkins/installing+jenkins+on+red+hat+distributions

On rpm-based distributions, such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora or scientific Linux, you can install J Enkins through Yum.

Recent versions is available in a YUM repository. installation

Add The Jenkins repository to the Yum repos, and install Jenkins from here. 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 installation of a stable version

There is also a LTS YUM repository for the lts Release line sudo wget-o/etc/yum.repos.d/jenkins.repo http://pkg.jenkins- Ci.org/redhat-stable/jenkins.repo sudo rpm--import https://jenkins-ci.org/redhat/jenkins-ci.org.key sudo yum install Jenkins installation of Java

Jenkins requires Java in order to run, yet certain distros don ' t include the this by default. To install the Open Java development Kit (OpenJDK) run the following:

sudo yum install Java

Note: If running CentOS, ensure you follow the guide below. start/stop sudo service Jenkins start/stop/restart sudo chkconfig Jenkins on

Note: If you get the following error message, ensure this Java has been installed:

Starting Jenkins (via Systemctl):  Job for Jenkins.service failed. See ' systemctl status Jenkins.service ' and ' journalctl-xn ' for details.
                                                           [FAILED]
What's does this?Jenkins'll is launched as a daemon on startup. See/etc/init.d/jenkins for more details. The ' Jenkins ' user is a created to run this service. If you have the different user via the config file, you must the owner Of/var/log/jenkins,/var/lib/jenkin S, And/var/cache/jenkins. Log file would be placed In/var/log/jenkins/jenkins.log. Check This file if you are troubleshooting Jenkins. /etc/sysconfig/jenkins'll capture configuration parameters for the launch. By default, Jenkins listen on port 8080.  Access this port with the your browser to start configuration.  Note that the built-in firewall could have a to is opened to access this port from other computers. (see http://www.cyberciti.biz/faq/disable-linux-firewall-under-centos-rhel-fedora/for instructions how to disable The firewall permanently) A Jenkins RPM repository is added In/etc/yum.repos.d/jenkins.repoDisable 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
Important Note on CentOS Java

Jenkins requires Java in order to run, however Yum install Jenkins does not enforce the Java is already installed. Check to make sure this already Hava Java installed by running Java-version. To further make things difficult for CentOS users, the default CentOS version of Java was not compatible with Jenkins. Jenkins typically works best with a Sun implementation of Java, which are not included in the CentOS for licensing reasons.

If you get output similar to the following, it means you ' re using the default (GCJ) version of Java, which won't work W ITH Jenkins:

Java-version
java Version "1.5.0"
gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)

To correct the-need to remove the GCJ version of Java and install a sun-compatible version.

If you received the above output, uninstall the default Java:

Yum Remove Java

Then after your ' ve uninstalled Java (or if you didn ' t has Java installed at all to begin with). You need to install a sun-compatible version of Java. The easiest approach is a using OpenJDK, which is available through the EPEL repository (alternatively Ficial RPM directly from Oracle). To install OpenJDK run the following:

Yum Install JAVA-1.7.0-OPENJDK

Depending on your version of CentOS, the package name is OpenJDK may differ. Use Yum search openjdk to check for the name of the package. If OpenJDK is not found at all through Yum, you probably need to install the EPEL Yum repository. After installation, you should is able to get the following output for java-version:

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) 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.