1, 安装程序包 yum install httpd subversion mod_dav_svn
2, 在启动httpd服务后,发现不能通过浏览器访问,一般以由于防火墙的原因,尝试 /etc/init.d/iptables stop 即可
3, 创建 subversion 仓库 svnadmin create /opt/subversion/repositories/svnveb
4, 使用 htpasswd 创建 subversion 访问帐户
htpasswd -c /opt/subversion/repositories/user.password username
5, 创建 subversion 访问策略文件 /opt/subversion/access.policy
6, 配置 /etc/httpd/conf.d/subversion.conf 文件如下:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be readable and writable by the 'apache' user. Note that if
# SELinux is enabled, the repositories must be labelled with a context
# which httpd can write to; this will happen by default for
# directories created in /var/www. Use "restorecon -R /var/www/svn"
# to label the repositories if upgrading from a previous release.
#
#
# To create a new repository "" using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
#
DAV svn
SVNParentPath /opt/subversion/repositories
# # Limit write permission to list of valid users.
#
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName "Subversion Repositories"
AuthUserFile /opt/subversion/user.password
AuthzSVNAccessFile /opt/subversion/access.policy
Satisfy Any
Require valid-user
#
7, 重启 httpd 服务
阅读(777) | 评论(0) | 转发(0) |