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

Thursday, April 16, 2020

How to setup SonaType Nexus 3 on Redhat Enterprise Linux in EC2? Nexus installation on RedHat Linux - Install Nexus on RedHat Linux

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

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 Open JDK
sudo yum install java-1.8.0-openjdk.x86_64 -y

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

Download Nexus
sudo wget http://download.sonatype.com/nexus/3/nexus-3.23.0-03-unix.tar.gz

Extract Nexus
sudo tar -xvf nexus-3.23.0-03-unix.tar.gz
sudo mv nexus-3.23.0-03 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

Configure to run as Nexus user
change as below screenshot by removing # and adding nexus
 sudo vi /opt/nexus/bin/nexus.rc

Modify memory settings in Nexus configuration file
sudo vi /opt/nexus/bin/nexus.vmoptions

Modify the above file as shown in red highlighted section:










-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:

Friday, June 15, 2018

How to Install Docker on RedHat Enterprise Linux 7.5 - Install docker on Linux RHEL -

Find steps for installing Docker 18.03.1 Community Edition on RHEL 7.5:

yum install -y yum-utils

sudo yum install wget

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

sudo rpm -ivh epel-release-latest-7.noarch.rpm

sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.55-1.el7.noarch.rpm


Setup Docker community repository on RedHat

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker CE

sudo yum install -y docker-ce

Start Docker daemon

sudo systemctl restart docker

Friday, June 8, 2018

Install Jenkins on Linux | Install Jenkins Red Hat Enterprise Linux 7.5 - How to setup Jenkins on Red Hat Linux

How to Install Jenkins on Red Hat Enterprise Linux?

Please find below steps:

You need to setup Java first.
 
sudo yum install wget -y

Java Installation
sudo yum install java-1.8.0-openjdk-devel -y

Add Jenkins repository to yum repository
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import http://pkg.jenkins.io/redhat-stable/jenkins.io.key

Install Jenkins
sudo yum install jenkins -y

Start Jenkins
sudo systemctl  start jenkins
sudo systemctl  enable jenkins

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..


Thursday, June 7, 2018

Install Ansible on RedHat linux - Install Ansible on RHEL 7.5 - How to install Ansible on RedHat Enterprise Linux 7.5 - Install Ansible on RedHat linux

How to Install Ansible on RedHat linux Enterprise ?

Let us see how to install Ansible on RedHat Enterprise Linux machine.

Download EPEL for Enterprise Linux

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Also enable the optional and extras repositories since EPEL packages may depend on packages from these repositories:

sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"

Update repository

sudo yum update

Install Ansible
sudo yum install ansible

ansible --version

Wednesday, June 6, 2018

TerraForm Installation Steps on RedHat Enterprise Linux (RHEL) 7.5 - How to install Terraform on RedHat Enterprise Linux 7.5 ?

Please find steps for installing Terraform on RedHat Enterprise Linux (RHEL) 7.5. You can install this on any of your existing RedHat Enterprise Linux EC2 instance.
Terraform is used for provisioning resources and infrastructure on Cloud. You don't need to create manually any resource on cloud.

Please find steps for installing Terraform on Linux:

sudo yum update
sudo mkdir -p /opt/terraform
cd /opt/terraform/
sudo yum install wget

Download Terraform
sudo wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip

Extract Terraform

sudo yum install unzip -y
sudo unzip terraform_0.11.7_linux_amd64.zip

Add Path to Profile
add Terraform installed path to PATH by modifying below file:

sudo vi /etc/profile

go to end of the file, add the below line:

export PATH=$PATH:/opt/terraform 

source /etc/profile
Verify Installation

now type  below command to see Terraform is installed or not:
terraform --version

Terraform v0.11.7