通用步骤
1.工具安装
[root@localhost conf]
# yum install subversion
2. 工具配置
[root@localhost svn]# mkdir -p /home/fileserver/svn/
[root@localhost svn]# svnadmin create /home/fileserver/svn/first/
[root@localhost svn]#
[root@localhost svn]# ls first/
conf db format hooks locks README.txt
[root@localhost svn]#
配置文件详解:
hooks目录:放置hook脚步文件的目录
locks目录:用来放置subversion的db锁文件和db_logs锁文件的目录,用来追踪存取文件库的客户端
format目录:是一个文本文件,里边只放了一个整数,表示当前文件库配置的版本号
conf目录:是这个仓库配置文件(仓库用户访问账户,权限)
配置文件修改
/home/fileserver/svn/first/conf/authz
[aliases]
[groups]
abc = abc1,abc2 // 赋予abc组的abc1,abc2 用户权限
[/] //一般设置为根目录,设置为其它貌似服务访问不了,原因未知
@abc = rw // abc1,abc2 权限为读写
/home/fileserver/svn/first/conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = My First Repository
/home/fileserver/svn/first/conf/passwd
[users]
abc1 = 123456
abc2=123456
3. 服务启动和关闭
svnserve -d -r /home/fileserver/svn
pkill svnserver
4.服务测试
svn checkout svn://localhost:/first
5.其它问题
1. os 没有组abc 也没有用户abc1,abc2, 服务测试(svn checkout svn://localhost:/first)是否可以成功 --- 可以成功
os有组abc,或者用abc1,abc2 账户 ,服务测试(svn checkout svn://localhost:/first)是否可以成功 --- 可以成功
2. 服务启动时候的目录为 -r 参数为fist(svnserve -d -r /home/fileserver/svn/first) 服务测试(svn checkout svn://localhost:/first)是否可以成功 --- 不可以,访问会提示
svn: E170000: URL 'svn://192.168.1.4/first' doesn't exist
服务启动时候的目录为多一个目录符号(svnserve -d -r /home/fileserver/svn/) 服务测试(svn checkout svn://localhost:/first)是否可以成功 --- 可以成功
3. 在/home/fileserver/svn/first/conf/passwd 配置文件中配置密码 “usr = passwd” 中 等号前后是否可以有空格 --- 可以用空格
4. svn log -v 后 svn: E220001: Unreadable path encountered; access denied 错误 解决方法
在/home/fileserver/svn/first/conf/authz 文件的[/]配置后 增加
* = r