2017-08-17 98 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

添加防火牆條目不會提升權限 –