1.安装
yum install httpd subversion mod_dav_svn
#运行
service httpd start
#设置开机启动
chkconfig httpd on
2.配置
找到/etc/httpd/conf.modules.d/目录
vim 10-subversion.conf
编辑以下内容
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule dontdothat_module modules/mod_dontdothat.so
Alias /svn /var/www/svn
<Location /svn>
DAV svn
SVNParentPath /var/www/svn/
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>
以上设置svn的目录/var/www/svn
设置AuthUserFiles用户密码文件/etc/svn-auth-users
设置svn服务的目录
mkdir /var/www/svn
cd /var/www/svn/
svnadmin create repo #创建svn源
配置权限
chown -R apache.apache /var/www/svn/
设置用户
htpasswd -cm /etc/svn-auth-users san.zhang
-c 创建文件,如果已存在则覆盖
-m采用md5加密密码
要求用户输入密码
htpasswd /etc/svn-auth-users si.li
chown -R apache:apache /var/www/svn
service httpd restart
初始化仓库
mkdir /tmp/testproject
导入
svn import /tmp/testproject/ file:///var/www/svn/repos/testproject -m "initial"
3.测试
svn co http://ipaddress/repo/testproject/