首页 技术 正文
技术 2022年11月14日
0 收藏 501 点赞 2,727 浏览 866 个字

一、问题

jenkins网站绑定域名后直接通过域名访问使用的是8080端口,为方便用户访问因此须监听80端口,而为了安全起见linux一般不用root身份运行,综上,需要以普通用户来运行监听80端口时就会启动失败,报没有权限,因为linux只有root身份才能监听1024以下的熟知端口。

二、解决

(以下未经验证)

There are a few different solutions to work around this:

Install and configure Apache or nginx as a reverse proxy server, which can be started as root to open the port, and then downgrade its privileges back to a normal user.

Set up a firewall on the server using iptables or an alternative, so that the lower port number is forwarded internally to a higher port number listened by Confluence.

Use jsvc, which is able to open ports as root, and then downgrade privileges.

Use authbind to grant privileges for a non-root user to open a privileged port.

(以验证可行)

通过firewalld进行端口转发

开启firewalld防火墙

systemctl start firewalld

开机启动

systemctl enable firewalld

放行80端口

firewall-cmd --permanent --zone=public --add-service=http

转发80端口流量到8080

firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=8080

立即生效

firewall-cmd --reload

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,497
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,910
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,744
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,497
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,135
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,298