Linux下安装SVN服务器

安装环境
CentOS 4.3 Final

软件列表
httpd-2.0.61.tar.gz
db-4.3.29.tar.gz
subversion-1.3.2.tar.gz

软件位置
/data/software

安装步骤
#mkdir /data/software/pkg -p

安装Berkeley DB
#cd /data/software/pkg
#tar zxvf ../db-4.3.29.tar.gz
#cd db-4.3.29/docs
#../dist/configure
#make && make install
#echo /usr/local/BerkeleyDB.4.3/lib >> /etc/ld.so.conf
#ldconfig

安装Apache
#cd /data/software/pkg
#tar zxvf ../httpd-2.0.61.tar.gz
#./configure --prefix=/usr/apache --enable-dav  / --with-berkeley-db=/usr/local/BerkeleyDB.4.3 --with-dbm=db43
#make && make install

安装Subversion
#cd /data/software/pkg
#tar zxvf ../db-4.3.29.tar.gz
#cd db-4.3.29
#./configure --with-apxs=/usr/apache/bin/apxs --prefix=/usr/local/subversion  / --with-apr=/usr/apache --with-apr-util=/usr/apache --with-ssl --with-zlib  / --enable-maintainer-mode --with-berkeley-db=/usr/local/BerkeleyDB.4.3
#make && make install

建立仓库
#groupadd svn
#useradd svnroot -g svn
#passwd svnroot
#su svnroot
#mkdir /data/svn/repository
#cd /usr/local/subversion/bin
#./svnadmin create /data/svn/repository/test
#cd /data/svn/svnroot/repository/test
#/usr/local/subversion/bin/svnadmin --version
#exit (返回root帐号)
#chmod 700 /data/website/svn/repository

配置SVN
#vi /usr/apache/conf/httpd.conf


   //找到下列语句,如果没有则自行添加
   LoadModule dav_svn_module modules/mod_dav_svn.so
   LoadModule authz_svn_module modules/mod_authz_svn.so
  //在后面添加
   <Location /svn>
   DAV svn
   SVNParentPath /data/website/svn/repository
   AuthzSVNAccessFile /etc/svn-access-file
   AuthType Basic
   AuthName "SVN Test"
   AuthUserFile /etc/svn-auth-file
   Require valid-user
   </Location>
   //<Location 后面的表示的是url,而他代表要访问的仓库的父目录,这里就是仓库test的父目录/data/website/svn/repository,http访问地址就是http://IP/svn/test,AuthzSVNAccessFile指定用户权限的文件位置及名称,AuthUserFile指定用户访问权限的文件位置及名称,AuthName为弹出窗口的标题,可以根据需要自定义,Require指定采用何种认证


#/usr/apache/bin/apachectl restart

生成验证用户 (第一次生成时加上参数c,以后增加用户则不用)
#/usr/apache/bin/htpasswd -(c)m /etc/svn-auth-file test
输入用户密码

分配权限
#vi /etc/svn-access-file


### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard.  Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[groups]
# harry_and_sally = harry,sally

# [/foo/bar]
# harry = rw
# * =

[/]
# @harry_and_sally = rw
# * = r
test = rw
steven = r

   //[groups]下面定义的是组名称及成员用户,[/]表示对整个test项目的操作,他下面的是用户或组在这个项目里的权限



修改Apache启动权限

#vi /usr/apache/conf/httpd.conf


   //将apache运行的用户和用户组改成跟仓库一样权限的用户及组
   User svnroot
   Group svn


#/usr/apache/bin/apachectl restart

访问http://IP/svn/test ,输入刚才创建的用户名和密码进行身份验证,且通过验证后应该可以看到信息。Rivision 1:/

 

相关资料:

http://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/index.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值