2017-08-17 99 views
0

我已经在Centos 7上基于Jetty服务器安装了Jenkins。 在配置文件中:/ etc/sysconfig/jenkins默认端口为8080,并且一切正常,但我需要在80端口上移动jenkins。如何将Jenkins配置为在Centos 7上的端口80上运行

当我将JENKINS_PORT =“8080”更改为JENKINS_PORT =“80”时 - jenkins不再可用。防火墙关闭了。

在日志消息:/var/log/jenkins/jenkins.log

Aug 17, 2017 12:07:45 PM org.eclipse.jetty.util.log.JavaUtilLog warn 
WARNING: FAILED [email protected]{HTTP/1.1}{0.0.0.0:80}: java.net.SocketException: Permission denied 
java.net.SocketException: Permission denied 
at sun.nio.ch.Net.bind0(Native Method) 
at sun.nio.ch.Net.bind(Net.java:433) 
at sun.nio.ch.Net.bind(Net.java:425) 
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) 
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) 
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321) 
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) 
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) 
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) 
at org.eclipse.jetty.server.Server.doStart(Server.java:366) 
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) 
at winstone.Launcher.<init>(Launcher.java:152) 
at winstone.Launcher.main(Launcher.java:352) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at Main._main(Main.java:293) 
at Main.main(Main.java:132)  

任何人都可以帮我这个问题?

回答

1

谷歌使我对低于1024 https://confluence.atlassian.com/confkb/permission-denied-error-when-binding-a-port-290750651.html

端口称为特权端口和Linux(和大多数UNIX系统和UNIX类系统),他们不允许任何非root用户打开。

所以当我运行启动脚本为JENKINS_USER =“jenkins”时,Permission denied error已经出现。

+0

此答案不完整。在确定问题的同时,您还没有提到解决方案。我所做的是在端口80上安装一个httpd并使用它来代理tomcat –

0

你可以试试Centos7防火墙设置吗?

不需要关闭防火墙。

firewall-cmd --zone=public --add-port=80/tcp --permanent 
firewall-cmd --zone=public --add-service=http --permanent 
firewall-cmd --reload 
firewall-cmd --list-all 

然后开始詹金斯。

+0

我也试过了,没有帮助。 – nimda

+0

添加防火墙条目不会提升权限 –