標籤:
安裝步驟如下:
1、yum install subversion
[[email protected] static]# yum install subversionLoaded plugins: securitybase | 3.7 kB 00:00 epel | 4.4 kB 00:00 epel/primary_db | 6.5 MB 00:01 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.7 MB 00:00 Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package subversion.x86_64 0:1.6.11-10.el6_5 will be updated---> Package subversion.x86_64 0:1.6.11-12.el6_6 will be an update--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package Arch Version Repository Size================================================================================Updating: subversion x86_64 1.6.11-12.el6_6 updates 2.3 MTransaction Summary================================================================================Upgrade 1 Package(s)Total download size: 2.3 MIs this ok [y/N]: yDownloading Packages:subversion-1.6.11-12.el6_6.x86_64.rpm | 2.3 MB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Updating : subversion-1.6.11-12.el6_6.x86_64 1/2 Cleanup : subversion-1.6.11-10.el6_5.x86_64 2/2 Verifying : subversion-1.6.11-12.el6_6.x86_64 1/2 Verifying : subversion-1.6.11-10.el6_5.x86_64 2/2 Updated: subversion.x86_64 0:1.6.11-12.el6_6 Complete!
2、輸入rpm -ql subversion查看安裝位置,如下:
[[email protected] static]# rpm -ql subversion/etc/bash_completion.d/etc/bash_completion.d/subversion/etc/rc.d/init.d/svnserve/etc/subversion/usr/bin/svn/usr/bin/svnadmin/usr/bin/svndumpfilter/usr/bin/svnlook/usr/bin/svnserve/usr/bin/svnsync/usr/bin/svnversion....
我們知道svn在bin目錄下產生了幾個二進位檔案。輸入 svn --help可以查看svn的使用方法,如。
[[email protected] static]# svn --helpusage: svn <subcommand> [options] [args]Subversion command-line client, version 1.6.11.Type ‘svn help <subcommand>‘ for help on a specific subcommand.Type ‘svn --version‘ to see the program version and RA modules or ‘svn --version --quiet‘ to see just the version number.Most subcommands take file and/or directory arguments, recursingon the directories. If no arguments are supplied to such acommand, it recurses on the current directory (inclusive) by default.Available subcommands: add blame (praise, annotate, ann) cat changelist (cl) checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (?, h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) resolve resolved revert status (stat, st) switch (sw) unlock update (up)Subversion is a tool for version control.For additional information, see http://subversion.tigris.org/
3、建立svn版本庫目錄
mkdir -p /alidata/www/static/svn/svnrepos
4、建立版本庫
svnadmin create /alidata/www/svn/svnrepos
執行了這個命令之後會在/alidata/www/svn/svnrepos目錄下產生如下這些檔案
# ls /alidata/www/svn/svnreposconf db format hooks locks README.txt
5、進入conf目錄(該svn版本庫設定檔) passwd是帳號密碼檔案authz檔案是許可權控制檔案svnserve.conf SVN服務組態檔 6、設定帳號密碼vi passwd在[users]塊中添加使用者和密碼,格式:帳號=密碼,如dan=dan 7、設定許可權vi authz在末尾添加如下代碼:[/]dan=rww=r@g_admin = rw意思是版本庫的根目錄dan對其有讀寫權限,w只有讀許可權。 8、修改svnserve.conf檔案vi svnserve.conf開啟下面的幾個注釋:anon-access = read #匿名使用者可讀auth-access = write #授權使用者可寫password-db = passwd #使用哪個檔案作為帳號檔案authz-db = authz #使用哪個檔案作為許可權檔案realm = /alidata/www/svn/svnrepos # 認證空間名,版本庫所在目錄 9、啟動svn版本庫svnserve -d -r /alidata/www/svn/svnrepos
linux(centos)搭建SVN伺服器