linux下svn的配置方法__linux

來源:互聯網
上載者:User

 

1、yum install subversion  # 安裝svn組件

 

安裝成功之後,可以看到如下相關的命令被產生:

[flykobe@localhost svnclient]$ svn svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion  

 

2、產生svn倉庫

 

svnadmin create /var/svnrepos

 

[flykobe@localhost svnrepos]$ ls -R .: conf dav db format hooks locks README.txt ./conf: authz passwd svnserve.conf ./dav: ./db: current format fs-type revprops revs transactions uuid write-lock ./db/revprops: 0 ./db/revs: 0 ./db/transactions: ./hooks: post-commit.tmpl post-revprop-change.tmpl pre-commit.tmpl pre-revprop-change.tmpl start-commit.tmpl post-lock.tmpl post-unlock.tmpl pre-lock.tmpl pre-unlock.tmpl ./locks: db.lock db-logs.lock 

 

修改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 = 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 conf directory. ### 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 conf ### directory. 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 

 

並利用htpasswd產生加密的帳號:

[flykobe@localhost svnrepos]$  htpasswd -cm conf/passwd flykobe # c是create

 

3、這時就可以訪問svn了:

[flykobe@localhost svnrepos]$ svn info file:///var/svnrepos/ 路徑:svnrepos 地址(URL):file:///var/svnrepos Repository Root: file:///var/svnrepos 檔案庫 UUID:f561f977-8526-4757-94ed-60f16aaa3677 修訂版:0 節點種類:目錄 最後修改的修訂版:0 最後修改的時間: 2009-12-29 17:17:02 +0800 (二, 29 12月 2009) 

 

4、將svn與apache關聯起來

 

yum install mod_dav_svn # 安裝svn的apache擴充,會在apache的module下產生mod_svn_dav.so

 

修改apache配置:

 

201 <Location /repos> 202 DAV svn 203 SVNPath /var/svnrepos/ 204 AuthType Basic 205 AuthName "Subversion repository" 206 AuthUserFile /var/svnrepos/conf/passwd 207 Require valid-user 208 </Location> 

 

重啟apache,之後可以利用http訪問svn了:

 

svn list http://127.0.0.1/repos

 

聯繫我們

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