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" />