Step 1: Launch an AWS EC2 Instance with Ubuntu
- Log in to the AWS Console.
- Navigate to the EC2 dashboard.
- Launch a new instance, choosing an Ubuntu AMI.
- Configure the instance type, storage, and security groups.
- Review and launch the instance, creating a new key pair or using an existing one to access the instance securely.
Step 2: Connect to Your AWS Instance Use SSH to connect to your AWS instance using the private key:
ssh -i "your-key.pem" ubuntu@your-instance-ip
Step 3: Install Java on Ubuntu
- Update the package manager:
sudo apt update
- Install Java (OpenJDK 11):
sudo apt install openjdk-11-jdk -y
- Verify the Java installation:
java -version
Step 4: Install Maven on Ubuntu The process for installing Maven on Ubuntu remains mostly the same as in the previous guide:
- Download the Apache Maven binary package:
wget https://apache.mirror.digitalpacific.com.au/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz
- Extract the downloaded package:
tar -zxvf apache-maven-3.8.4-bin.tar.gz
- Move Maven to a system directory:
sudo mv apache-maven-3.8.4 /usr/local/
- Add Maven to the system path:
echo 'export M2_HOME=/usr/local/apache-maven-3.8.4' | sudo tee -a /etc/profile.d/maven.sh
echo 'export M2=$M2_HOME/bin' | sudo tee -a /etc/profile.d/maven.sh
echo 'export PATH=$M2:$PATH' | sudo tee -a /etc/profile.d/maven.sh
- Activate the changes:
sudo chmod +x /etc/profile.d/maven.sh
source /etc/profile.d/maven.sh
- Verify the Maven installation:
mvn -version
Step 5: Install Jenkins on Ubuntu The process for installing Jenkins on Ubuntu is slightly different:
- Add the Jenkins repository and import its GPG key:
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
- Update the package manager:
sudo apt update
- Install Jenkins:
sudo apt install jenkins -y
- Start and enable the Jenkins service:
sudo systemctl start jenkins
sudo systemctl enable jenkins
- Open your AWS security group to allow traffic on port 8080 (Jenkins UI).
Step 6: Configure Jenkins The configuration of Jenkins remains the same as in the previous guide. Follow steps 5 and 6 from the original instructions to configure Jenkins.
Comments
Post a Comment