mac lion svnserver搭建 筆記

來源:互聯網
上載者:User

good:

http://2015.iteye.com/blog/1212802

Mac內建了svn服務端和用戶端,所以我們不用再去下載了。

下面我列出配置步驟:

1: 在你的mac上建立一個目錄,作為將來svn伺服器的工作空間。

    例如:你建立了一個目錄“svnroot”  (很多人想知道目錄的完整路徑,選中svnroot--》右鍵--》查看詳情 如 : ( 注意   "位置: /wf "  字樣))

               那麼你的本地完整路徑就是  /wf/svnroot

    

2: 去svnroot中看一下,檔案夾中現在應該是空的,在下面建立一個repository目錄

3: 運行黑黑的shell終端將2中建立的 repository 指定為svn server的版本庫目錄

        執行命令:

       svnadmin create /wf/svnroot/repository

       

     然後你在repository 中應該能看見新產生了一些檔案: 如:

  4: 修改repository/conf目錄中的設定檔。 有三個檔案  authz、passwd、svnserve.conf

       4.1:    authz  修改後應該像下面這樣:

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
monsters_group=wanfan
[/]
wangfan=rw
*=

# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

      4.2   passwd  修改後應該如下

### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
wangfan=1234567890

4.3 svnserve.conf 修改後應該如下:### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 2565: 啟動svn伺服器輸入下面的命令:  svnserve -d -r /wf/svnroot/repository沒有任何提示就說明啟動成功了。6: 在你的mac 上建立一個空的目錄作為你的提交目錄:(關鍵是本地可訪問) 資訊如:(wangfanapi 就是原始碼目錄)

                               

7: 將6中建立的目錄匯入到版本管理倉庫repository中。
      shell 命令如下:
       svn import /wf/svnroot/temps/wangfanapi/ svn://localhost/svn/repository/wangfanapi --username wangfan --password 1234567890 -m "init import"
                              
                           

 如果你能看見上面步驟7中的樣子。。 每一行前面的 adding xxx 就表好似正在將本地檔案添加到版本管理系統中。

8:檢出項目: (在bash視窗下面你到任意一個目錄,然後運行下面的命令就能將剛才 7 中匯入的項目檢出)
      svn checkout svn://localhost/svn/repository/wangfanapi --username=wangfan --password=1234567890

//-------------------------------------------------後記-------------------------------
 problem A  如果遇到提示 *********** 翻譯過來就是 資料畸形。。。  和 JAVAHL 有關的一個東東。
            answer: 把整個ecllipse 卸載了,  重新安裝了ADT 和 subclipse
                            (注意subclipse 用的是1.6,原因是 subversion1.8 需要搭配 javahl1.7 這個我不知道是否自動更新下來的東西符合條件。
                                                                關於搭配參見:   http://subclipse.tigris.org/wiki/JavaHL
                             ) 
         ADT更新地址:                       https://dl-ssl.google.com/android/eclipse
        subversion 1.6 更新地址:       http://subclipse.tigris.org/update_1.6.x

problem B: 
        Not authorized to open root of edit operation
         http://www.blogjava.net/zhouf/articles/251635.html

        Subversion裝了1.5.2版,烏龜SVN裝的是1.5.1版本,可以通過烏龜正常訪問到版本庫,但當check out時卻出現了"Not authorized to open root of edit operation"錯誤,上網搜尋了一下,提供的解決版本如下:
anon-access 屬性對目錄許可權的影響
你想將你的程式碼程式庫開放給所有人訪問,於是你就開放了匿名存取權限,在 svnserve.conf 檔案中添加一行:"anon-access=read"。可是對於部分目錄,你又不希望別人看到,於是針對那些特別目錄,你在 authz.conf 裡面進行配置,添加了授權訪問的人,並添加了"* ="標記。你認為一切OK了,可是你卻發現,那個特別目錄卻無法訪問了,總是提示"Not authorized to open root of edit operation"或者"未授權開啟根進行編輯操作"。你再三檢查你配置的使用者名稱與密碼,確認一切正確,還是無法解決問題
原來,Subversion 有個小 bug ,當"anon-access=read"並且某個目錄有被設定上"* ="標記,則會出現上述問題。這個 bug 在當前最新版本上(v1.4)還存在
但我並沒有設"*="這種訪問方式,使用者名稱、密碼、目錄訪問都正確設定了。當把 anon-access=read 改成 anon-access=none 後,發現,真的可以正常訪問了

           

    

        

     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.