linux下搭建svn倉庫,window下訪問 頂 原

今天遇到了一個linux下svn坑的地方,windows應該是不會出現的.建議配置的時候不要多餘刪除東西,完全按照我的配置來

配置環境centos6.8

1.安裝svn

    yum install subversion

2. 創建版本庫

    svnadmin create /home/svnHome

查看home下的目錄就會多出一個svnHome,進入此目錄可以看到一些文件,主要關注conf下三個配置文件

    [root[@localhost](https://my.oschina.net/u/570656) svnHome]# cd conf/
    [root[@localhost](https://my.oschina.net/u/570656) conf]# ls
    authz  passwd  svnserve.conf

3. 配置svnserve.conf

這個文件主要設置一些svn服務的配置

    vim svnserve.conf 

修改配置文件如下

[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 = none
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.

4.配置passwd文件

這個文件主要用於添加用戶

    vim passwd

修改配置文件如下

[users]
# harry = harryssecret
# sally = sallyssecret
hsm=123456
~

5.配置authz 文件權限

這個主要給用戶分配讀寫權限

    vim authz

修改配置文件如下


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

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin=hsm
# [/foo/bar]
# harry = rw
# &joe = r
# * =

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

6.配置文件完成了之後,就是打開服務了

    svnadmin -r -d /home/

我就知這個地出現了問題,千萬不要寫成

svnserve -r -d /home/svnHome

7.導出文件的時候也要注意

本機導出:

svn checkout svn://localhost/home/svnHome

其他機器就換成ip就好了

8. 如果配置出現了問題,可以執行下面的命令重啓服務

    $ ps -aux|grep svnserve
    $ kill -9 ID號   殺死服務
    $ svnserve -d -r /svn

參考博客鏈接: 常見錯誤 客戶端連接

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章