CentOS安裝和部署SVN服務器

一、安裝SVNweb

經過yum安裝svnapp

[root@localhost webber]# yum install subversion

查看svn是否安裝成功svn

[root@localhost webber]# svn --version svn, version 1.7.14 (r1542130) compiled Apr 11 2018, 02:40:28 Copyright (C) 2013 The Apache Software Foundation.

二、配置版本庫 this

修改svn的默認數據根目錄/var/svn,也能夠不修改,此處我將數據根目錄設置爲/home/svnspa

[root@localhost home]# vi /etc/sysconfig/svnserve # OPTIONS is used to pass command-line arguments to svnserve. # # Specify the repository location in -r parameter: OPTIONS="-r /home/svn"

建立本身的版本庫code

[root@localhost home]# svnadmin create /home/svn/webber

配置版本庫的用戶名和密碼,"用戶名" = "密碼"server

[root@localhost home]# vi /home/svn/webber/conf/passwd
[users] # harry = harryssecret # sally = sallyssecret webber = 123456

配置版本庫的權限blog

[root@localhost home]# vi /home/svn/webber/conf/authz

在文件末尾加上用戶的權限,如webber版本庫根目錄的讀寫權限ci

[webber:/] webber = rw

修改版本庫的配置域名

[root@localhost home]# vi /home/svn/webber/conf/svnserve.conf
[general] anon-access = none #控制非鑑權用戶訪問版本庫的權限 auth-access = write #控制鑑權用戶訪問版本庫的權限 password-db = passwd #指定用戶名口令文件名 authz-db = authz #指定權限配置文件名 realm = /home/svn/webber               #指定版本庫的認證域,即在登陸時提示的認證域名稱

全部配置均已經完成,最後一步,啓用版本庫

[root@localhost home]# svnserve -d -r /home/svn/

三、使用版本庫

而後checkout試試可否成功更新版本庫webber

[root@localhost webber]# svn checkout svn://192.168.0.108/webber
Authentication realm: <svn://192.168.0.108:3690> /home/svn/webber
Password for 'root': Authentication realm: <svn://192.168.0.108:3690> /home/svn/webber
Username: webber Password for 'webber': ----------------------------------------------------------------------- ATTENTION!  Your password for authentication realm: <svn://192.168.0.108:3690> /home/svn/webber
 can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details. You can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'. ----------------------------------------------------------------------- Store password unencrypted (yes/no)? yes Checked out revision 0. [root@localhost webber]# ll total 0 drwxr-xr-x. 3 root root  18 Jul 15 01:07 webber
相關文章
相關標籤/搜索