如何在 Ubuntu 12.04 服务器上远程访问 Jenkins?

ezr*_*tre 5 jenkins

我已经在 Ubuntu 12.04 服务器上安装了 Jenkins 并打开了端口 8080,但仍然无法远程访问 Jenkins。以下是我采取的程序。

# Install Jenkins, enable UFW and open port 8080
sudo apt-get install jenkins
sudo ufw enable
sudo ufw allow 8080
sudo ufw reload

# Check the status
sudo ufw status
8080    ALLOW    Anywhere
8080    ALLOW    Anywhere (v6)

# Locally
curl -I localhost:8080
HTTP/1.1 200 OK
Server: Winstone Servlet Engine v0.9.10
...

# On an external machine
curl -I [ip]:8080
couldn't connect to host
Run Code Online (Sandbox Code Playgroud)

小智 7

我遇到了这个问题,该问题已通过编辑 jenkins 配置文件解决

须藤vim /etc/default/jenkins

编辑 HTTP_HOST,默认 127.0.0.1 到

HTTP_HOST=0.0.0.0

  • 我的文件中什至没有 **HTTP_HOST** 。你是如何得到的? (3认同)

cho*_*ple 0

添加 JENKINS_ARGS

JENKINS_ARGS="--prefix=/jenkins --httpListenAddress=YOUR_IP --ajp13ListenAddress=YOUR_IP"
Run Code Online (Sandbox Code Playgroud)

在 Centos/Redhat 上,您可以在 /etc/sysconfig/jenkins 中找到。