42

我想安装詹金斯,但我不能得到认证工作。我在CentOS 6.2上运行Tomcat6上的jenkins。我启用登录,一切都很顺利,直到我尝试登录。在给我的凭据和按登录后,tomcat给我一个错误:

“HTTP状态404 - 所请求的资源()不可用。在http://myserver:8080/jenkins/j_acegi_security_check詹金斯 - j_acegi_security_check

通过google搜索我能找到这样的: https://issues.jenkins-ci.org/browse/JENKINS-3761

两个建议的修复,我发现:

  • 在Tomcat运行詹金斯而不是运行单机版 - 我 上午已经在这么做了。
  • 编辑一个文件:WEB-INF /安全/ SecurityFilters.groovy - 我想 编辑,但我不能让它改变什么

有什么我可以做,以使这项工作?

+0

FWIW它最近开始发生在我身上,我被重定向到'j_acegi_security_check'空白页Ø在Chrome和Opera上登录尝试。原来的问题是我有一个* Fiddler代理启用*由于某种原因阻止我登录。 – 2016-04-13 09:18:53

回答

87

用这个摔跤,确保在Jenkins中选择授权方法时设置安全领域。

也就是说,在管理詹金斯→配置全球安全选择在安全领域列表中的一个选项。

例如:

enter image description here

+3

我希望我可以给这个10张选票。 – 2016-12-07 01:46:42

0

我在Ubuntu和AIX上都面临同样的问题,在这个问题上我非常需要它在生产环境中工作。我甚至尝试了Tomcat和Apache Web服务器,但仍然是同样的问题。

最后改变的类加载器如下使得它在单机模式下工作:

java -jar jenkins.war --httpPort=79802 --preferredClassLoader=java.net.URLClassLoader & 

顺便说一句,这是标准的詹金斯分配的Ubuntu,从那里我得到了线索默认设置。

可能这个问题与包装有关,但现在这个解决方案的工作。检查这是否解决类似的问题。

+0

有问题的机器不再存在,但感谢告诉,因为它可能在未来有用。 – varesa 2012-11-28 17:16:25

-1

我在“/ jenkins/j_acegi_security_check”URI上有相同的HTTP 404。

在我的情况下,詹金斯运行在由用户'root'启动的Tomcat上。停止Tomcat,并由适当的单独应用程序用户重新启动它。问题解决了。

+0

它可能已经以root身份运行,因为它是由百胜安装的服务。我想我将其配置为别的东西,虽然运行... – varesa 2013-04-19 13:40:52

0

我有同样的HTTP 404对 “/詹金斯/ j_acegi_security_check” URI问题。

与上面pga指出的问题相同:Tomcat正以root用户身份启动。

这是因为我通过在“/etc/init.d/”创建启动tomcat脚本来设置tomcat自动重启。

解决了该问题与:

su - tomcatuser - c /cde/pkgs/../tomcat/start.sh 
7

the bug page提到:

The error was caused by a proxy pass rule "/jenkins http://localhost:9080/jenkins/" which led to the incomming (jenkins) request "/jenkins//j_acegi_security_check" (double //). So the login page was rejected with 404 (while all other pages where served).

确保您/jenkins的ProxyPass不与目标URL斜线结尾。

+0

我不认为这是唯一的问题,因为它是不同的固定安装詹金斯。我不确定在这一点上它是否属于代理。编辑:我不是100%,这是一定的,虽然,比较日至serverfault我的问题,这可能是它。无法验证我的具体情况,所以不会选择答案,但有一个upvote – varesa 2014-07-24 13:33:45

-1

看到投票下来:我在新服务器上再次执行这些步骤。 有**人物和我删除

有失踪$符号像这样的tomcat $ TOMCAT_VERSION

(两者纠正,这是工作)(更新于2016年3月28日)

禁用安全性,如下所示:

http://markunsworth.com/2012/02/13/locked-yourself-out-of-jenkins/

无法登录詹金斯,并不能禁止登录选项要么 或者 在Tomcat上与Jenkins进行登录时锁定。

http://xx.xxx.xxx.xxx:8080/jenkins/login?from=/jenkins/和填充的帐户密码,这是不成立的一切之后,总是会到这个页面

http://xx.xxx.xxx.xxx:8080/jenkins/j_acegi_security_check 

HTTP状态404 - 描述请求的资源不可用。

我有.war文件安装在tomcat中 我花了很长时间才解决了这个问题。 我曾多次完全去除的Tomcat,詹金斯的所有文件夹.jenkins等重新安装并没有什么...

删除Tomcat和詹金斯完全再次...

解决的办法是正确使用的用户和组,让我们看看如何通过逐个运行以下命令。

您使用sudo权限以用户(例如vimal)登录。

[email protected]:~$ sudo apt-get update 
[email protected]:~$ BASE_USER=vimal 
[email protected]:~$ sudo chown -Rf $BASE_USER:$BASE_USER /opt/ 

[email protected]:~$ USER=apache-tomcat 
[email protected]:~$ GROUP=myjenkins 
[email protected]:~$ TOMCAT_INSTALL_DIR=/opt 
[email protected]:~$ TOMCAT_VERSION=apache-tomcat-8.0.23 
[email protected]:~$ TOMCAT_URL=http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.zip 

对于TOMCAT_URL,从archive/src()复制所需的链接。Tomcat的下载站点

[email protected]:~$ mkdir -p $TOMCAT_INSTALL_DIR 
[email protected]:~$ cd $TOMCAT_INSTALL_DIR 
[email protected]:~$ wget $TOMCAT_URL 
[email protected]:~$ unzip -q $TOMCAT_VERSION.zip 
[email protected]:~$ rm $TOMCAT_VERSION.zip 

的拉链)运行命令下面你需要有JAVA_HOME像JAVA_HOME设置= “/ usr/lib中/ JVM/JAVA-8 ORACLE /” 加入到这个 须藤之前nano/etc/environment

[email protected]:~$ sudo chmod +x $TOMCAT_INSTALL_DIR/$TOMCAT_VERSION/bin/*.sh 
[email protected]:~$ $TOMCAT_INSTALL_DIR/$TOMCAT_VERSION/bin/catalina.sh start 
[email protected]:~$ 
[email protected]:~$ cd $TOMCAT_INSTALL_DIR/$TOMCAT_VERSION/webapps/ 
[email protected]:~$ wget http://mirrors.jenkins-ci.org/war-stable/latest/jenkins.war 

等待几分钟,直到Jenkins完全加载。需要2GB内存。 尝试去http://xx.xxx.xxx.xxx:8080/jenkins/的浏览器,它会工作...

花了我一天的时间找到解决方案。

0

这是我如何解决这个问题:

# service tomcat status 
tomcat start/running, process 996 

# service tomcat stop 
tomcat stop/waiting 

# service jenkins status 
Jenkins Continuous Integration Server is not running 

# service jenkins restart 
* Restarting Jenkins Continuous Integration Server jenkins    [ OK ] 
# service tomcat start 
tomcat start/running, process 3839 

# service jenkins status 
Jenkins Continuous Integration Server is running with the pid 3694 

刷新浏览器和詹金斯应该是启动和运行。 希望这有助于!

0

我有同样的问题与404的“/詹金斯/ j_acegi_security_check”页面上。

使用詹金斯和Tomcat,很多的尝试后,解决它,我来到了以下解决方案 - 使用18080作为无SSL重定向默认端口I'm。 It's相关的重定向,但在这种情况下(如使用Tomcat),它具有在tomcat服务器配置进行更改:

查找范围/conf/server.xml以下项:

<Connector port="18080" protocol="HTTP/1.1" 
    connectionTimeout="20000" 
    redirectPort="8443" /> 

只是注释掉redirectPort帮我:

<Connector port="18080" protocol="HTTP/1.1" 
    connectionTimeout="20000" />