這兩天在服務器搭建了一個SVN服務器,一些經驗,也留作后用把,有不詳細的歡迎批評指正
另外關於子目錄的訪問配置,這塊我還是不懂,希望有前輩能教我一下
1.安裝SVN Server
yum install subversion
2.驗證安裝
svnserve --version
3.創建版本庫
mkdir /repo -- 新建repo文件夾
svnadmin create /repo/aaa -- 新建aaa版本
4.啟動,殺掉服務
svnserve -d -r /repo/aaa
ps -aux | grep svn
kill 進程號
5.自動啟動
vi /etc/rc.local
在最后一行加上
svnserve -d -r /repo/aaa
下面貼配置文件:
1.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. ### 對於授權用戶與未被授權用戶的訪問級別控制:read,write,write 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. ### 密碼數據文件的保存位置,默認為相對路徑,如果以/開頭則為絕對路徑 ### 如果SASL開啟的話,那么就不會驗證該文件 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. ### 指定驗證的范圍,如果兩個repo的realm屬性一樣,那么它們就應該使用同一個password數據庫,反之亦然 ### 默認的realm就是repo的唯一標示符 realm = 0.1 [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.' ### 是否開啟SASL驗證,默認是false的 ### 此選項會默認svn服務器支持Cyrus,檢查的方法是,運行'svnserve --version'命令,查看輸出是否有'Cyrus SASL authentication is available.' # use-sasl = false ### 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 = 256
2.passwd:這個就是配置用戶的,格式是-->username = passwd
[users] tang = lin alin = tang
3.authz
### 配置一個組,右邊的是組內的成員的username [groups] g_manager = tang,alin ### svn根目錄 ### 給組配置權限 [/] @g_manager = rw