Skip to content

Latest commit

 

History

History
 
 

nexus-installation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Landmark Technologies.

Contacts: +1437 215 2483
WebSite : http://mylandmarktech.com/

Nexus Installation And Setup In AWS EC2 Redhat Instance.

Pre-requisite
  • AWS Acccount.
  • Create Redhat EC2 t2.medium Instance with 4GB RAM.
  • Create Security Group and open Required ports.
    • 8081 ..etc
  • Attach Security Group to EC2 Instance.
  • Install java openJDK 1.8+ for Nexus version 3.15

Create nexus user to manage the Nexus server

#As a good security practice, Nexus is not advised to run nexus service as a root user, 
# so create a new user called nexus and grant sudo access to manage nexus services as follows. 
sudo hostname nexus
sudo useradd nexus
# Grand sudo access to nexus user
sudo echo "nexus ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/nexus
sudo su - nexus

Install Java as a pre-requisit for nexus and other softwares

cd /opt
sudo yum install wget git nano unzip -y
sudo yum install java-11-openjdk-devel java-1.8.0-openjdk-devel -y

Download nexus software and extract it (unzip).

sudo wget http://download.sonatype.com/nexus/3/nexus-3.15.2-01-unix.tar.gz 
sudo tar -zxvf nexus-3.15.2-01-unix.tar.gz
sudo mv /opt/nexus-3.15.2-01 /opt/nexus

Grant permissions for nexus user to start and manage nexus service

# Change the owner and group permissions to /opt/nexus and /opt/sonatype-work directories.
sudo chown -R nexus:nexus /opt/nexus
sudo chown -R nexus:nexus /opt/sonatype-work
sudo chmod -R 775 /opt/nexus
sudo chmod -R 775 /opt/sonatype-work

Open /opt/nexus/bin/nexus.rc file and uncomment run_as_user parameter and set as nexus user.

# change from #run_as_user="" to [ run_as_user="nexus" ]

vi /opt/nexus/bin/nexus.rc

CONFIGURE NEXUS TO RUN AS A SERVICE

sudo ln -s /opt/nexus/bin/nexus /etc/init.d/nexus

#9 Enable and start the nexus services
sudo systemctl enable nexus
sudo systemctl start nexus
sudo systemctl status nexus
echo "end of nexus installation"