i setup the jenkins server in ubuntu 18 in ec2 aws. this is the bash script i used.
#!/bin/bash
sudo apt update
sudo apt install openjdk-11-jdk -y
sudo apt install maven -y
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
https://pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
###
for security group i set all traffic from anywhere. i am able to ssh to instance and check systemctl status jenkins. i shows running. but when i access jenkins by using pub ip with port :8080. i doest not load.
i tried removing and adding every rule to security group but nothing helped. also i am using default vpc.
thank you
2
Answers
Hii try to reinstall Jenkins manually
Follow the Following steps to install Jenkins manually.
` Installing Jenkins in Ubuntu
latest steps
wget -q -O – https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add –
sudo sh -c ‘echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’
sudo apt-get update
sudo apt-get install jenkins
`
It seems that your Jenkins server is running on a public EC2 instance and you can access it using the following link (I just tested this using both my home PC and mobile phone and I can see the Jenkins initialPassword screen)
http://YOUR_EC2_PUBLIC_IP:8080/
If you still cant access it from your work machine, then the failure to connect to it may be caused by some network filtering in your work network. Please try to access it on your mobile phone to test this theory.