Apache-2.2

mod_dav_svn 不允許經過身份驗證的使用者

  • March 7, 2013

我正在執行 CentOS 6.3 伺服器以及自定義編譯 apache 2.4.3(下面的編譯行)和自定義編譯的 subversion 1.7.8(再次,下面的編譯行)。

我已經設置了 mod_dav_svn,它只工作了一半。如果我訪問 svn.domain.com/svn,它會詢問我的使用者名和密碼。我可以很好地登錄(它只問我一次),我可以毫無問題地瀏覽儲存庫。如果我然後在 Windows 機器上訪問 tortoisesvn 並嘗試簽出儲存庫(例如 svn.domain.com/svn/testrepo),則會彈出登錄視窗。我輸入我的憑據並點擊保存,然後確定。視窗再次彈出。我可以一遍又一遍地輸入我的憑據,但它什麼也沒做(它就像我的使用者名和密碼錯誤,但我知道它們不是)。錯誤日誌中沒有顯示任何內容,訪問日誌中也沒有顯示任何奇怪的內容。如果我禁用身份驗證,一切正常。哈!

編輯:我做了一個“chmod -R 777 /u01/svn”來看看是否解決了這個問題。沒有骰子。出於同樣的原因,svnauth 文件也是 777。

虛擬主機配置

<VirtualHost *:80>
   ServerAdmin tony@domain.om
   DocumentRoot "/u01/www/vhosts/svn"
   ServerName svn.domain.com
   ErrorLog "logs/svn.domain.com-error_log"
   CustomLog "logs/svn.domain.com-access_log" common
   <Location /svn>
       DAV svn
       SVNParentPath /u01/svn/
       SVNListParentPath On
       AuthType Basic
       AuthName "Subversion repository"
       AuthUserFile /usr/local/apache/conf/svnauth
       Require valid-user
   </Location>
</VirtualHost>

配置交換機

阿帕奇

"./configure" \
"--prefix=/usr/local/apache" \
"--enable-ssl" \
"--enable-rewrite=shared" \
"--enable-status=shared" \
"--enable-info=shared" \
"--enable-so"

顛覆

'./configure' \
'--with-serf' \
'--enable-ssl' \
'--prefix=/usr/local/subversion' \
'--with-apr=/usr/local/apache/bin/apr-1-config' \
'--with-apr-util=/usr/local/apache/bin/apu-1-config'

目錄列表結果

[pritchea@server ~]$ ls -l /u01/svn/
total 12
drwxrwxrwx 6 pritchea wheel 4096 Jan 24 04:44 repo1
drwxrwxrwx 6 pritchea wheel 4096 Jan 15 03:20 repo2
drwxrwxrwx 6 pritchea wheel 4096 Mar  7 20:13 testrepo
[pritchea@server ~]$ ls -l /u01/svn/*
/u01/svn/repo1:
total 24
drwxrwxrwx 2 pritchea wheel 4096 Jan 24 04:44 conf
drwxrwxrwx 6 pritchea wheel 4096 Jan 24 04:51 db
-rwxrwxrwx 1 pritchea wheel    2 Jan 24 04:44 format
drwxrwxrwx 2 pritchea wheel 4096 Jan 24 04:44 hooks
drwxrwxrwx 2 pritchea wheel 4096 Jan 24 04:44 locks
-rwxrwxrwx 1 pritchea wheel  229 Jan 24 04:44 README.txt

/u01/svn/repo2:
total 24
drwxrwxrwx 2 pritchea wheel 4096 Jan 15 03:20 conf
drwxrwxrwx 6 pritchea wheel 4096 Feb 12 02:26 db
-rwxrwxrwx 1 pritchea wheel    2 Jan 15 03:20 format
drwxrwxrwx 2 pritchea wheel 4096 Jan 15 03:20 hooks
drwxrwxrwx 2 pritchea wheel 4096 Jan 15 03:20 locks
-rwxrwxrwx 1 pritchea wheel  229 Jan 15 03:20 README.txt

/u01/svn/testrepo:
total 24
drwxrwxrwx 2 pritchea wheel 4096 Mar  7 20:13 conf
drwxrwsrwx 6 pritchea wheel 4096 Mar  7 20:13 db
-rwxrwxrwx 1 pritchea wheel    2 Mar  7 20:13 format
drwxrwxrwx 2 pritchea wheel 4096 Mar  7 20:13 hooks
drwxrwxrwx 2 pritchea wheel 4096 Mar  7 20:13 locks
-rwxrwxrwx 1 pritchea wheel  229 Mar  7 20:13 README.txt

擺脫DocumentRoot指令。它對 . 無效DAV svn

引用自:https://serverfault.com/questions/485709