CentOS 7 x64安装subversion

大城市里の小女人 提交于 2020-08-16 09:37:20

一、安装SVN软件

yum -y install subversion

二、创建仓库目录

mkdir /var/svnrepos

三、创建工程项目

svnadmin create /var/svnrepos/svn-demo

四、进入工程目录

[root@centos ~]# cd /var/svnrepos/svn-demo/
[root@centos svn-demo]# ls
conf  db  format  hooks  locks  README.txt
[root@centos svn-demo]# cd conf/
[root@centos conf]# ls
authz  passwd  svnserve.conf
[root@centos conf]#

五、修改配置文件

vi svnserve.conf
[general]
anon-access = none      # 控制非鉴权用户访问权限。缺省值为:read
                        # 取值范围【"read":"只读"、"write":"可读可写"、"none":"没有访问权限"】
auth-access = write     # 控制已鉴权用户访问权限。缺省值为:write
                        # 取值范围【"read":"只读"、"write":"可读可写"、"none":"没有访问权限"】
password-db = passwd    # 指定账号密码文件。缺省值:passwd
                        # 除非指定绝对路径,否则指向conf目录下的文件
authz-db = authz        # 指定权限配置文件,通过该文件可以实现以路径为基础的访问控制。缺省值:authz
                        # 除非指定绝对路径,否则指向conf目录下的文件
realm = svn-demo        # 指定版本库认证域,即在登录时提示的认证域名称
vi svnserve.conf
[users]
svnuser = svnuser2020
vi authz
[svn-demo:/]
svnuser = rw

六、查看SVN进程

ps -ef | grep svnserve

七、启动SVN服务

svnserve -d -r /var/svnrepos/        PS:-d 表示后台进程 -r 指定仓库目录

八、使用SVN检出

[root@centos home]# svn checkout svn://10.10.10.10:3690/svn-demo
Authentication realm: <svn://10.10.10.10:3690> svn-demo
Password for 'root':
Authentication realm: <svn://10.10.10.10:3690> svn-demo
Username: svnuser
Password for 'svnuser':

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://10.10.10.10:3690> svn-demo

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)? no
A    svn-demo/src
A    svn-demo/src/test
A    svn-demo/src/test/java
A    svn-demo/src/main
A    svn-demo/src/main/java
A    svn-demo/src/main/java/wth
A    svn-demo/src/main/java/wth/auto
A    svn-demo/src/main/java/wth/auto/deploy
A    svn-demo/src/main/java/wth/auto/deploy/Application.java
A    svn-demo/src/main/resources
A    svn-demo/src/main/resources/application.yml
A    svn-demo/pom.xml
Checked out revision 1.
[root@centos home]#

九、开启SVN端口

firewall-cmd --zone=public --permanent --add-port=3690/tcp
systemctl restart firewalld.service
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!