[轉]subversion 出現 Repository moved permanently to 'xxx' please relocate 的錯誤

來源:互聯網
上載者:User

在使用subversion的過程中碰到過很多次的
Repository moved permanently to 'http://svn.jdkcn.com/labs/'; please relocate
剛開始的時候是把checkout下來的代碼先刪除了.重新checkout就好了.後來發現只要switch到checkout時候的url也正常了. 在網上也搜尋過這個錯誤.不過別人都是checkout的時候出錯的.我的都是在svn update的時候出現的.所以一直沒有解決.

今天終於打到問題的原因了.原來是在subversion 的FAQ中的問題.

I can see my repository in a web browser, but 'svn checkout' gives me an error about "301 Moved Permanently". What's wrong? It means your httpd.conf is misconfigured. Usually this error happens when you've defined the Subversion virtual "location" to exist within two different scopes at the same time.
For example, if you've exported a repository as <Location /www/foo>, but you've also set your DocumentRoot to be /www, then you're in trouble. When the request comes in for /www/foo/bar, apache doesn't know whether to find a real file named /foo/bar within your DocumentRoot, or whether to ask mod_dav_svn to fetch a file /bar from the /www/foo repository. Usually the former case wins, and hence the "Moved Permanently" error.
The solution is to make sure your repository <Location> does not overlap or live within any areas already exported as normal web shares.
It's also possible that you have an object in the web root which has the same name as your repository URL. For example, imagine your web server's document root is /var/www and your Subversion repository is located at /home/svn/repo. You then configure Apache to serve the repository at http://localhost/myrepo. If you then create the directory /var/www/myrepo/ this will cause a 301 error to occur.


中文版:

我可以從一個WEB瀏覽器上查看我的版本庫,但是在執行'svn checkout' 時發生一個錯誤:"301 Moved Permanently"。那個地方出錯了。 這意味著你的httpd.conf配置有問題,通常情況下,當你設定的Subversion虛擬目錄同時存在兩種定址方式的時候會出現這樣的錯誤。
例如,當你將版本庫放到/www/foo目錄下,但是你又同時設定了你的版本庫的根目錄為/www,那麼你就麻煩了。當有人請求 一個/www/foo/bar檔案的時候,apache根本不會知道,對方真正想要尋找的檔案,是在根目錄裡下的/foo/bar,還是通過調用 mod_dav_svn模組從/www/foo版本庫中去把/bar檔案給取回來,通常Apache的處理行為是採取前者的方式,因此就會出現“永久轉移 ”這樣的錯誤了。
解決這個問題的辦法就是確認你的版本庫路徑不會有重疊,或者存在其他網際網路共用可訪問的路徑裡面。
出現這個問題還有一個可能的原因,就是在網站根目錄存在一個和版本庫的URL同名的檔案(檔案夾)。例如,假設你的WEB伺服器的根目錄設定在 /var/www,你的Subversion版本庫被放置在/home/svn/repo目錄下,然後你在Apache下將該版本庫的URL配置成http://localhost/myrepo。如果你這時又在/var/www下建立了一個myrepo的目錄,那麼同樣會產生301的錯誤。
我在/svn/repos 下有很多個svn repository,所以就在/svn/repos下放了一個index.html來串連到各自的repository地址.所以就和上面提到的問題一樣把 /svn/repos 配置成 <Location了.這樣訪問某個repository的時候 /repos/xx ,Apache就不確定該去解析/repos/xx下的檔案.還是用mod_svn去訪問版本.不過奇怪的是我只在svn update的時候才碰到,svn checkout的時候確正常.不過總算是找到問題了.把原來的/svn/repos/index.html換到其他目錄再配置<Location> 一切ok了.

原文地址:http://jdkcn.com/entry/subversion-repository-moved-permanently-problem.html

我遇到的問題是:client更新出錯,右鍵專案檔夾--》TorToise --》Relocate 修改項目擷取目錄。儲存後即可更新,

因為我svn伺服器端的SVNParentPath配的是/svn 而不是項目目錄/svn/test/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.