ubuntu安装svn

安装svn

# sudo apt-get install subversion

创建svn仓库

# cd /root
# mkdir svn
# cd svn
# svnadmin create repos

配置svn

# cd repos/conf
# vi svnserve.conf

anon-access:匿名用户的权限,可以为read,write和none
auth-access:认证用户的权限
password-db:密码数据库的路径
authz-db:认证规则库的路径

如果出现如下错误:

svn: E200002: Error while parsing config file: /root/svn/repos/conf/svnserve.conf:
svn: E200002: line 19: Option expected

错误原因就是svnserve.conf配置文件,配置项没有顶格

# vi passwd
thomas = 111111 //明文
# vi authz
[groups]    //组设置
admin = thomas

[/]
thomas = rw

[repos:/]
@admin = rw

如果出现如下错误:

svn: E220003: Unable to connect to a repository at URL 'svn://10.0.2.15'
svn: E220003: 认证配置无效

错误原因就是passwd配置文件,配置项组或者用户配置有问题

注意:修改配置,重启svn才生效

启动和停止
停止:

# pkill svnserve

启动:

# svnserve -d -r /root/svn/repos

访问
根据authz配置来决定访问路径

# vi authz
[/]         //svn://10.0.2.15/
[repos:/]   //svn://10.0.2.15/repos
posted @ 2017-06-26 16:28  thomas_blog  阅读(127)  评论(0编辑  收藏  举报