我在我的 Debian 服务器上安装了 Jenkins。它设置在端口 8080 上,当我尝试连接它时,什么也没发生。我知道它正在运行,因为当我执行以下操作时:
root@jini01:/etc/default# /etc/init.d/jenkins restart
我把这个拿回来了。
[ ok ] Restarting Jenkins Continuous Integration Server: jenkins.
这是我的詹金斯配置文件:
# defaults for jenkins continuous integration server
# pulled in from the init script; makes things easier.
NAME=jenkins
# location of java
JAVA=/usr/bin/java
# arguments to pass to java
#JAVA_ARGS="-Xmx256m"
#JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address
PIDFILE=/var/run/jenkins/jenkins.pid
# user id to be invoked as (otherwise will run as root; not wise!)
JENKINS_USER=jenkins
# location of the jenkins war file
JENKINS_WAR=/usr/share/jenkins/jenkins.war
# jenkins home location
JENKINS_HOME=/var/lib/jenkins
# set this to false if you don't want Hudson to run by itself
# in this set up, you are expected to provide a servlet container
# to host jenkins.
RUN_STANDALONE=true
# log location. this may be a syslog facility.priority
JENKINS_LOG=/var/log/jenkins/$NAME.log
#HUDSON_LOG=daemon.info
# OS LIMITS SETUP
# comment this out to observe /etc/security/limits.conf
# this is on by default because http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835$
# reported that Ubuntu's PAM configuration doesn't include pam_limits.so, and as a result the # of file
# descriptors are forced to 1024 regardless of /etc/security/limits.conf
MAXOPENFILES=8192
# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080
# port for AJP connector (disabled by default)
AJP_PORT=-1
# servlet context, important if you want to use apache proxying
PREFIX=/jenkins
# arguments to pass to jenkins.
# --javahome=$JAVA_HOME
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --ajp13Port=$AJP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
# --prefix=$PREFIX
当我做 :
ps aux | grep -i java
我得到:
root 12912 0.0 0.0 7676 892 pts/0 S+ 19:04 0:00 grep -i java
为什么即使我指定了 8080 端口它也不会显示在浏览器上?
答案1
尝试执行telnet <server-ip> 8080
。如果没有任何反应,则意味着防火墙阻止了该端口
答案2
尝试:
$ /sbin/sysctl net.ipv6.bindv6only
如果此值为 1,则需要禁用该设置:
$ sudo /sbin/sysctl net.ipv6.bindv6only=0
对于持久的修复:检查/etc/sysctl.conf
此/etc/sysctl.d/*
设置,并在更改后重新启动。
答案3
您的文件 (/etc/default/jenkins) 末尾缺少一些行,例如
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"
JENKINS_ARGS="$JENKINS_ARGS --prefix=$PREFIX"