svn 从安装到配置

来源:互联网 发布:网络创业靠谱吗 编辑:程序博客网 时间:2024/04/30 18:16
1,解压安装包
tar zxvf subversion-1.6.17.tar.gz
tar zxvf subversion-deps-1.6.17.tar.gz #这个解压的内容会自动解压到subversion-1.6.17目录下边,这两个安装包一定要确保在同一个目录下


2,安装
(1) cd subversion-1.6.17
(2) ./configure --prefix=/usr/local/svn  #--prefix参数指定把svn安装到哪个目录下边
    注:此版本在linux centos5.5下边安装会报configure: error: no XML parser was found: expat or libxml 2.x required错误
    解决办法如下:
(3) tar zxfv expat-2.1.0.tar.gz
(4) cd expat-2.1.0
(5) ./configure
(6) make #编译
(7) make install #安装 或者编译和安装同时执行,make && make install (做这步之前可以先做第(8)步,就不会报错了,第(9)步也就可以省了。)
    make install 之后会报error while loading shared libraries: libexpat.so.1: cannot open shared object file: No such file or directory这样一个错误,找不到共享库libexpat.so.1
解决办法如下:
(8) cp expat-2.1.0/.libs/libexpat.so.1 /lib
(9) make install #重新make install


3,关联svn数据目录
svnserve -d -r /usr/local/svndata/ #关联目录


4,创建版本库(以下创建在svndata目录下)
svnadmin create test2 #创建版本库(后边test2是自己起的名字)


5,配置(以下[authz,passwd,svnserve.conf]三个文件在自己创建的版本conf下,用vim打开就可以。)
例:cd /usr/local/svndata/test2/conf


authz #权限配置文件


[aliases] #别名配置
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average


[groups]#用户组配置
admin = songfei,yangli,fuxinye
[/]#用户组相应的目录权限配置
@admin = rw




passwd #用户名和密码配置文件(用户配置)


[users]
songfei = songfei #等号左边为用户名,等号右边是用户的密码
yangli = yangli
fuxinye = fuxinye




svnserve.conf #svn主配置文件


[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = none #匿名用户权限控制  read读 write可读可写 none不可读也不可写
auth-access = write #授权用户可读可写
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd #使用用户验证
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz #使用用户授权
原创粉丝点击