85261748 2010-09-12
在Fedora安装SVN服务器:
1. 软件安装
yum -y install httpd subversion mod_dav_svn
2. 在服务里面使能httpd
3. root下创建SVN repositories路径,设置路径权限:
mkdir -p /var/lib/subversion/repositories
chown -R apache:apache /var/lib/subversion
4. 编写shell脚本,设置可执行属性,放在/bin/make-repos,运行建立SVN 项目,如make-repos svn_prj
#!/bin/shif [ $# -ne 1 ]; then echo 1>&2 Usage: $0 repository_name exit 127fiecho "Sudoing...";svnadmin create --fs-type fsfs /var/lib/subversion/repositories/${1}chown -R apache:apache /var/lib/subversion/repositories/${1}chmod -R g+w /var/lib/subversion/repositories/${1}chmod g+s /var/lib/subversion/repositories/${1}/db
5. vi /etc/httpd/conf.d/subversion.conf,添加
<Location /svn>
DAV svn SVNParentPath /var/lib/subversion/repositories Satisfy Any AuthType Basic AuthName "subversion@tming" AuthzSVNAccessFile /var/lib/subversion/access.auth AuthUserFile /var/lib/subversion/passwords Require valid-user</Location>
6.建立 password file 和access file:
$ htpasswd -c /var/lib/subversion/passwords ming
$vi /var/lib/subversion/access.auth
[svn_prj:/]
ming=wr
7. 重启 Apache
$ /etc/init.d/httpd restart
pub_svnserve.conf的 pub_authz.conf的配置文件有非法字符的原因引起,需要查找pub_authz.conf提的非法内容比如多余的空格删除或直接将pub_authz.conf