我已经在 debian 7 上安装了 Jenkins。现在我想在端口 80 上运行它,这样我就可以简单地http://jenkins
在我的本地 LAN 上键入而不是http://jenkins:8080
(目前可以工作)。我已将文件修改/etc/default/jenkins
为:
# port for HTTP connector (default 8080; disable with -1)
#HTTP_PORT=8080
#HTTP_PORT=88
HTTP_PORT=80
但是当我重新启动 jenkins 服务sudo service jenkins restart
并尝试访问时http://jenkins:80
,我只会得到一个空白/错误页面。日志显示 ( /var/log/jenkins/jenkins.log
):
java.io.IOException: Failed to start a listener: winstone.HttpListener
at winstone.Launcher.spawnListener(Launcher.java:229)
at winstone.Launcher.<init>(Launcher.java:181)
at winstone.Launcher.main(Launcher.java:384)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at Main._main(Main.java:288)
at Main.main(Main.java:98)
Caused by: java.io.IOException: Failed to listen on port 80
at winstone.HttpListener.getServerSocket(HttpListener.java:122)
at winstone.HttpListener.start(HttpListener.java:75)
at winstone.Launcher.spawnListener(Launcher.java:220)
... 8 more
Caused by: java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
at java.net.ServerSocket.bind(ServerSocket.java:336)
at java.net.ServerSocket.<init>(ServerSocket.java:202)
at java.net.ServerSocket.<init>(ServerSocket.java:158)
at winstone.HttpListener.getServerSocket(HttpListener.java:117)
... 10 more
Sep 11, 2013 9:09:30 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Sep 11, 2013 9:09:30 PM hudson.WebAppMain$3 run
SEVERE: Failed to initialize Jenkins
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:502)
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:43)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:906)
at jenkins.model.Jenkins.<init>(Jenkins.java:806)
at hudson.model.Hudson.<init>(Hudson.java:81)
at hudson.model.Hudson.<init>(Hudson.java:77)
at hudson.WebAppMain$3.run(WebAppMain.java:221)
Exception in thread "pool-2-thread-1" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
我尝试运行sudo netstat -lp
但没有看到任何端口信息(看起来没有任何应用程序在端口 80 上运行)。我也尝试过使用 port=88 但它给出了相同的结果。
有什么建议么?