在Linux上搭建VisualSVN Server(svn服务端)

在Linux上搭建VisualSVN Server(svn服务端)
一、检查是否安装了低版本的SVN

rpm -qa | grep subversion

如果已安装SVN,则会返回版本信息。这时需要卸载旧版本的SVN。

卸载旧版本SVN

yum remove subversion

2、安装SVN

yum install subversion

3、检查安装是否成功

svnserve --version

在Linux上搭建VisualSVN Server(svn服务端)

4、代码库创建

mkdir -p /opt/svn/repositories

svnadmin create /opt/svn/repositories

执行上面的命令后,自动建立repositories库,查看/opt/svn/repositories(路径和库名可以根据自己的需要修改) 文件夹发现包含了conf,db,format,hooks,locks, README.txt等文件,说明一个SVN库建立完成。
在Linux上搭建VisualSVN Server(svn服务端)
在Linux上搭建VisualSVN Server(svn服务端)

5、配置代码库

进入上面生成的文件夹conf下,进行配置

cd /opt/svn/repositories/conf

5.1 用户密码passwd配置

# vi passwd
在Linux上搭建VisualSVN Server(svn服务端)

5.2 权限控制authz配置

# vi authz

目的是设置哪些用户可以访问哪些目录,authz文件的内容如下:在Linux上搭建VisualSVN Server(svn服务端)

5.3 服务svnserve.conf配置

# vi svnserve.conf

svnserve.conf文件部分修改内容如下:

在Linux上搭建VisualSVN Server(svn服务端)
在Linux上搭建VisualSVN Server(svn服务端)
在Linux上搭建VisualSVN Server(svn服务端)
在Linux上搭建VisualSVN Server(svn服务端)

5.4 启动SVN服务

# svnserve -d -r /opt/svn/repositories

6、查看进程

ps -ef|grep svn|grep -v grep

在Linux上搭建VisualSVN Server(svn服务端)

7、查看SVN监听的端口

netstat -ln |grep 3690

在Linux上搭建VisualSVN Server(svn服务端)

8、停止启动SVN

killall svnserve #停止

svnserve -d -r /opt/svn/repositories #启动

9、安装SVN客户端

目前最流行的svn客户端非TortoiseSVN莫属

下载安装

http://tortoisesvn.sourceforge.net/downloads.html

10、 测试SVN

客户端连接地址:svn://公网或内网的IP地址,有时候需要添加端口号

用户名/密码:test/123456 ##要和之前设置的用户名和密码匹配

在Linux上搭建VisualSVN Server(svn服务端)

在Linux上搭建VisualSVN Server(svn服务端)
在Linux上搭建VisualSVN Server(svn服务端)