Centos搭建SVN伺服器subversion

來源:互聯網
上載者:User

標籤:svn   linux   

1、安裝  subversion

yum install subversion#最終顯示Installed:  subversion.x86_64 0:1.6.11-12.el6_6                                                                                                                                                          Dependency Installed:  apr.x86_64 0:1.3.9-5.el6_2       apr-util.x86_64 0:1.3.9-3.el6_0.1     libproxy.x86_64 0:0.3.0-10.el6     libproxy-bin.x86_64 0:0.3.0-10.el6     libproxy-python.x86_64 0:0.3.0-10.el6      neon.x86_64 0:0.29.3-3.el6_4     pakchois.x86_64 0:0.4-3.2.el6         perl-URI.noarch 0:1.40-2.el6      Complete!#代表安裝成功

2、判斷是否安裝成功

svnserve --versionsvnserve, version 1.6.11 (r934486)   compiled Feb 10 2015, 22:08:22Copyright (C) 2000-2009 CollabNet.Subversion is open source software, see http://subversion.tigris.org/This product includes software developed by CollabNet (http://www.Collab.Net/).The following repository back-end (FS) modules are available:* fs_base : Module for working with a Berkeley DB repository.* fs_fs : Module for working with a plain file (FSFS) repository.Cyrus SASL authentication is available.

3、建立SVN庫。

[[email protected] ~]# mkdir -p  /opt/svn/repos[[email protected] ~]# svnadmin create /opt/svn/repos

執行完上面的命令後,在repos下建立conf, db,format,hooks, locks, README.txt。

4、配置svn

進入上面產生的檔案夾conf下,進行配置,   有以下幾個檔案authz, passwd, svnserve.conf
其中authz 是許可權控制,可以設定哪些使用者可以訪問哪些目錄,   passwd是設定使用者和密碼的,    svnserve是設定svn相關的操作。

[[email protected] ~]# cd /opt/svn/repos[[email protected] repos]# lltotal 24drwxr-xr-x 2 root root 4096 Feb 24 06:31 confdrwxr-sr-x 6 root root 4096 Feb 24 06:31 db-r--r--r-- 1 root root    2 Feb 24 06:31 formatdrwxr-xr-x 2 root root 4096 Feb 24 06:31 hooksdrwxr-xr-x 2 root root 4096 Feb 24 06:31 locks-rw-r--r-- 1 root root  229 Feb 24 06:31 README.txt[[email protected] repos]#


進入conf開啟passwd

[[email protected] repos]# cd conf[[email protected] conf]# lltotal 12-rw-r--r-- 1 root root 1080 Feb 24 06:31 authz-rw-r--r-- 1 root root  309 Feb 24 06:31 passwd-rw-r--r-- 1 root root 2279 Feb 24 06:31 svnserve.conf[[email protected] conf]# vim passwd
[users]# harry = harryssecret# sally = sallyssecretningyuqiao=ningyuqiao使用者名稱=密碼

開啟authz,設定許可權

[/]ningyuqiao=rw

意思是ningyuqiao使用者對所有的目錄有讀寫權限

設定svnserv.conf

anon-access = none # 使非授權使用者無法訪問auth-access = write # 使授權使用者有寫入權限password-db = passwdauthz-db = authz   # 存取控制檔案realm = /opt/svn/repos # 認證命名空間,subversion會在認證提示裡顯示,並且作為憑證緩衝的關鍵字。

注意:把中文全部去掉,否則會報錯。

啟動svn服務

svnserve -d -r /opt/svn/repos

如果已經有svn在運行,可以換一個連接埠運行

svnserve -d -r /opt/svn/repos --listen-port 3391

採用TortoiseSVN, 串連地址為: svn://your server address (如果指定連接埠需要添加連接埠  :連接埠號碼)

本文出自 “我的部落格” 部落格,請務必保留此出處http://ningyuqiao.blog.51cto.com/5581274/1615063

Centos搭建SVN伺服器subversion

相關文章

聯繫我們

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