Showing posts with label Redhat. Show all posts
Showing posts with label Redhat. Show all posts

Thursday, March 7, 2024

Install Jenkins on Red Hat Enterprise Linux 9 | How to setup Jenkins on RHEL | Install Jenkins on Red Hat Linux

How to Install Jenkins on RedHat Enterprise Linux 9?

Please find below steps for setting up Jenkins on RHEL 9.

Pre-requisites:

  • Memory should be t2.medium (4 GB RAM)
  • port 8080 opened in firewall rule to access Jenkins
  • Connect to EC2 instance using git bash or iTerm

update package

sudo yum update

Install wget
sudo yum install wget -y

Add Jenkins repository to yum repository
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-2023.key

sudo yum upgrade -y

Java Installation

# Add required dependencies for the jenkins package 
sudo yum install fontconfig java-17-openjdk -y

Install Jenkins
sudo yum install jenkins -y
sudo systemctl daemon-reload

sudo systemctl enable jenkins

Start Jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins

Now go to browser and access the Jenkins page.

http://dns_name:8080

Your page will look something like this. Now paste the password into the below Administrator password text box.

Get Jenkins Admin Password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the output of the above command.
Press Continue..Click on install suggested plug-ins..


 Install suggested plug-ins.
Now create user name and password.
enter everything as admin. at least user name as admin password as admin
Click on Save and Finish. Click on start using Jenkins. Now you should see a screen like below:


That's it. You have setup Jenkins successfully 😊

Tuesday, October 1, 2019

How to setup SonaType Nexus 3 on Linux in EC2? Nexus installation on RedHat Linux | Install Nexus on RedHat Linux

Nexus is an open source, Java based binary repository manager, used for storing build artifacts. We will eventually integrate Nexus with Jenkins for uploading WAR/EAR/JAR files.

Here are the steps for installing Sonatype Nexus 3 in RHEL in EC2 on AWS. Please create a new Redhat EC2 instance with small type. Choose Redhat Enterprise 8.

Pre-requisites:
Make sure you open port 8081 in AWS security group

Installation Steps:

sudo yum install wget -y






Download Java 8
sudo yum install java-1.8.0-openjdk.x86_64 -y

you can confirm java is installed by typing the below command:
java -version

Execute the below command to navigate to /opt directory by changing directory:

cd /opt

Download Nexus Latest version

sudo wget -O nexus3.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz

Extract Nexus
sudo tar -xvf nexus3.tar.gz
sudo mv nexus-3* nexus

Create a user called Nexus
sudo adduser nexus

Change the ownership of nexus files and nexus data directory to nexus user.
sudo chown -R nexus:nexus /opt/nexus
sudo chown -R nexus:nexus /opt/sonatype-work


Add Nexus as a user
sudo vi /opt/nexus/bin/nexus.rc
change as per above screenshot by removing # and adding nexus 
 
 
 
 

Modify memory settings in Nexus configuration file

sudo vi /opt/nexus/bin/nexus.vmoptions

Modify the above file as shown in below:

-Xms512m
-Xmx512m
-XX:MaxDirectMemorySize=512m
after making changes, press wq! to come out of the file.

Configure Nexus to run as a service

sudo vi /etc/systemd/system/nexus.service
Copy the below content highlighted in green color.

[Unit]
Description=nexus service
After=network.target
[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Restart=on-abort
[Install]
WantedBy=multi-user.target


Create a link to Nexus
sudo ln -s /opt/nexus/bin/nexus /etc/init.d/nexus

Execute the following command to add nexus service to boot.

sudo chkconfig --add nexus
sudo chkconfig --levels 345 nexus on


Start Nexus
sudo service nexus start







Check whether Nexus service is running
sudo service nexus status


Check the logs to see if Nexus is running
tail -f /opt/sonatype-work/nexus3/log/nexus.log

You will see Nexus started..If you Nexus stopped, review the steps above. 
Now press Ctrl C to come out of this windows.

Once Nexus is successfully installed, you can access it in the browser by URL - http://public_dns_name:8081

Click on Sign in link
user name is admin and password can be found by executing below command:

sudo cat /opt/sonatype-work/nexus3/admin.password




Copy the password and click sign in.
Now setup admin password as admin123


You should see the home page of Nexus:



Please follow steps for integrating Nexus with Jenkins


Please watch my YouTube channel on demo on How to setup Nexus 3 on Red Hat Linux in AWS:


Wednesday, July 31, 2019

Install Jenkins on RedHat Enterprise Linux 8 - How to setup Jenkins on RHEL

How to Install Jenkins on RedHat Enterprise Linux 8?

Please find below steps for setting up Jenkins on RHEL 8.

update package

sudo yum update

Install wget
sudo yum install wget -y

Java Installation

Download Java from Oracle site.

sudo wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm'

Install from RPM
sudo  rpm -i jdk-8u141-linux-x64.rpm

Add Jenkins repository to yum repository

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

Install Jenkins
sudo yum install jenkins -y

Start Jenkins
sudo service jenkins start
sudo service jenkins status

Get Jenkins Admin Password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the output of the above command.
Now go to browser and access the Jenkins page.

http://dns_name:8080

Your page will look something like this. Now paste the password into the below Administrator password text box.

Press Continue..Click on install suggested plug-ins..


 Install suggested plug-ins.

Friday, February 15, 2019

How to setup Jenkins on Redhat Enterprise Linux? Jenkins installation on RedHat Linux - Install Jenkins on RedHat Linux

Here are the steps for installing Jenkins on RedHat Enterprise Linux.

You need to setup Java first.

Make sure you have installed wget.

sudo yum install wget -y

Java Installation

Download Java from Oracle site.

sudo wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm'


Install from RPM
sudo  rpm -i jdk-8u141-linux-x64.rpm

Add Jenkins repository to yum repository

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

Install Jenkins
sudo yum install jenkins -y

Start Jenkins
sudo service jenkins start
sudo service jenkins status

You should see below message. that confirms that Jenkins is up and running.
 jenkins.service - LSB: Jenkins Automation Server
   Loaded: loaded (/etc/rc.d/init.d/jenkins; bad; vendor preset: disabled)
   Active: active (running) since Fri 2018-06-08 19:41:28 UTC; 4min 34s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15404 ExecStart=/etc/rc.d/init.d/jenkins start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/jenkins.service

Get Jenkins Admin Password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the output of the above command.
Now go to browser and access the Jenkins page.

http://your_server_name:8080

Your page will look something like this. Now paste the password into the below Administrator password text box.
Press Continue..Click on install suggested plug-ins..

That's it Jenkins is successfully installed..


🚀 Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp – Sep 2026

Live AI-Enabled DevSecOps & Cloud Engineering Bootcamp from Coach AK - Sep 2026 Schedule