标签:
1,安装:
# yum install subversion
判断是否安装成功:
# svnserve –version
2,建立SVN库:
# mkdir /opt/svn/repos # svnadmin create /opt/svn/repos
执行上面的命令后,自动在repos下建立多个文件, 分别是conf, db,format,hooks, locks, README.txt。
----------------------------------------------------------------------------------------------------
3,设置passwd
# nano /opt/svn/repos/conf/passwd
[users] # harry = harryssecret # sally = sallyssecret username = password #这样我们就建立了用户username
4,设置authz
# nano /opt/svn/repos/conf/authz
[/] username = rw # [/] 意思为所有目录 # username = rw 意思为username拥有读写权限 # 合起来就是username对所有目录拥有读写权限
5,设置svnserv.conf
# nano /opt/svn/repos/conf/svnserv.conf
anon-access = none # 使非授权用户无法访问 auth-access = write # 使授权用户有写权限 password-db = password # 指定password authz-db = authz # 访问控制文件 realm = /opt/svn/repos # 认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字。
采用默认配置. 以上语句都必须顶格写, 左侧不能留空格, 否则会出错.
----------------------------------------------------------------------------------------------------
6,连接
启动svn:
# svnserve -d -r /opt/svn/repos
如果已经有svn在运行,可以换一个端口运行(默认端口为:3690):
svnserve -d -r /opt/svn/repos --listen-port 3691
这样同一台服务器可以运行多个svnserver
链接地址为:
svn://localhost:3690
完!
标签:
原文地址:http://my.oschina.net/u/2475088/blog/511570