yum安装svn
[root@e ~]# yum -y install subversion
[root@e ~]# mkdir -pv /data/svn
初始化svn目录
[root@e ~]# svnadmin create /data/svn
修改svn配置文件
[root@e conf]# pwd
/data/svn/conf
[root@e conf]# vim svnserve.conf
[root@e conf]# cp svnserve.conf svnserve.conf.bak
[root@e conf]# vim svnserve.conf
[root@e conf]# cat svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = My First Repository
[sasl]
修改密码文件
[root@e conf]# vim passwd
[users]
ops = o1123312
修改账号权限文件
[root@e conf]# vim authz
#增加下面内容
[/]
ops = rw
启动svn服务
[root@e conf]# svnserve -d -r /data/svn/ --listen-port=3690
[root@e conf]# ps aux | grep svn
root 13239 0.0 0.0 176596 868 ? Ss 14:13 0:00 svnserve -d -r /data/svn/ --listen-port=3690
root 13241 0.0 0.0 112664 972 pts/1 S+ 14:13 0:00 grep --color=auto svn
svn安装到此完成。下面试一下windows简单导出:
apache svn https
yum install httpd httpd-devel mod_dav_svn mod_ssl openssl
配置httpd的svn内容
[root@e ~]# vi /etc/httpd/conf.d/subversion.conf
<Location /svn>
DAV svn
#svn仓库的父目录
SVNParentPath /data
SVNListParentPath on
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /data/svn/httpd-passwd
AuthzSVNAccessFile /data/svn/httpd-authz
Require valid-user
SSLRequireSSL
</Location>
创建httpd用的账号密码与权限文件:
#账号密码,第一次使用-c,后面第二个用户去掉-c
[root@e ~]# htpasswd -c /data/svn/httpd-passwd ops
New password:
Re-type new password:
Adding password for user ops
#用户与组访问权限
[root@e ~]# vim /data/svn/httpd-authz
[groups]
[/]
ops = rw
[/es]
zt = rw
配置https证书
cd /etc/pki/tls/private
openssl genrsa -out svn.key 1024
openssl req -new -key svn.key -out svn.csr
cd /etc/pki/tls/certs
openssl x509 -req -days 365 -in /etc/pki/tls/private/svn.csr -signkey /etc/pki/tls/private/svn.key -out svn.crt
vi /etc/httpd/conf.d/ssl.conf
#修改参数:
SSLCertificateFile /etc/pki/tls/certs/svn.crt
SSLCertificateKeyFile /etc/pki/tls/private/svn.key
#启动httpd服务
chown -R apache:apache /data/svn
systemctl restart httpd
systemctl enable httpd
如下图,在一个空文件夹右键,选择checkout, URL地址https://your-ip-address/svn/svn/ (这里第一个/svn是httpd里面配置的location名字,第二个/svn表示的是/data目录下的/svn仓库目录,需要根据你的httpd的location和仓库目录修改), 保存ssl信息,输入账号密码即可。