【发布时间】:2019-12-05 10:37:38
【问题描述】:
我在 https://app.vagrantup.com/centos/boxes/7 上运行 jenkins,它在 8080 端口上运行良好。
我在过去 2 个小时里一直在寻找将端口从 8080 更改为 80。没有成功 我一直在“拒绝连接”。
我猜这是某种防火墙问题?
centos box 是最小的 jenkins,java 只是安装在上面的应用程序。
到目前为止,我尝试了这些。
https://jenkins.io/doc/book/installing/
firewall-cmd --permanent --new-service=jenkins
firewall-cmd --permanent --service=jenkins --set-short="Jenkins Service Ports"
firewall-cmd --permanent --service=jenkins --set-description="Jenkins service firewalld port exceptions"
firewall-cmd --permanent --service=jenkins --add-port=80/tcp
firewall-cmd --permanent --add-service=jenkins
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
从这里更新端口 vi /etc/sysconfig//jenkins JENKINS_PORT="80"
how to change port number for Jenkins installation In Ubuntu 12.04
https://wiki.jenkins.io/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions
我正在使用 puppet 安装 Jenkins
exec {'Add Jenkins Repo':
command => 'yum-config-manager --add-repo http://pkg.jenkins-ci.org/redhat/jenkins.repo && rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key',
path => '/usr/bin:/bin',
unless => 'ls /etc/yum.repos.d/jenkins.repo',
}
exec { 'Install Java':
command => 'yum -y install java',
unless => 'ls /usr/bin/java',
path => ['/bin', '/usr/bin', '/usr/sbin'],
# noop => true,
}
exec { 'Install dejavu-sans-fonts': # https://wiki.jenkins.io/display/JENKINS/Jenkins+got+java.awt.headless+problem
command => 'yum -y install dejavu-sans-fonts',
unless => 'ls /usr/share/fonts/dejavu/', # TODO Find location
path => ['/bin', '/usr/bin', '/usr/sbin'],
}
exec { 'Install fontconfig': # https://wiki.jenkins.io/display/JENKINS/Jenkins+got+java.awt.headless+problem
command => 'yum -y install fontconfig',
unless => 'ls /usr/share/fontconfig', # TODO Find location
path => ['/bin', '/usr/bin', '/usr/sbin'],
}
exec { 'Install Jenkins':
command => 'yum -y install jenkins',
unless => 'ls /etc/init.d/jenkins',
path => ['/bin', '/usr/bin', '/usr/sbin'],
require => Exec['Install Java', 'Add Jenkins Repo', 'Install dejavu-sans-fonts', 'Install fontconfig'],
# noop => true,
}
service { 'jenkins':
ensure => 'running',
# enable => true,
require => Exec['Install Jenkins'],
}
更新
[root@jenkins]# firewall-cmd --query-port=80/tcp
yes
[root@jenkins]# firewall-cmd --query-port=8080/tcp
yes
【问题讨论】:
标签: jenkins