'How to access Jenkins running on EC2 MAC instance?
I have been working on Jenkins setup on AWS EC2 MAC instance. After installation of Jenkins on MAC instance, I'm able to access Jenkins from the MAC locally by giving 'localhost:8080'. But i'm unable to do the same on other web browsers by using 'instance Public IP:8080'. However, we were able to connect to the instance via SSH successfully.
Below are some of the solutions we have tried:
- Including the port 8080 in the AWS Security group.
- Ensured that the internet gateway modem is enabled with the instance.
- Further we tried to enable All Ports in the AWS Security group.
- Configured local system firewall settings and tried too.
- Added ICMP to the security group.
- Tried to configure MAC instance's firewall as well.
All these solutions hadn't worked out. Is there anything else I had missed implementing?
Solution 1:[1]
How you have installed Jenkins on the MAC? If you are used homebrew to install Jenkins here is the answer:
If your Jenkins running through Homebrew,
Since the folder is a hidden folder on macOS. so you will need to do the following things to unhide the folder.
Open Macintosh HD in finder -> and press cmd + shift + . (dot)
This will reveal all hidden folders.
After you unhidden the folder, paste the below command in the terminal:
nano /usr/local/Cellar/jenkins-lts/2.xxx/homebrew.mxcl.jenkins-lts.plist
Change httpListenAddress 127.0.0.1 to 0.0.0.0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.jenkins</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Dmail.smtp.starttls.enable=true</string>
<string>-jar</string>
<string>/usr/local/opt/jenkins/libexec/jenkins.war</string>
<string>--httpListenAddress=0.0.0.0</string>
<string>--httpPort=8080</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Once the above steps are done, you can access the Jenkins using hostname or public IP address.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ojer_Dev |
