目录[-]
From Wikipedia:
1 – Install Subversion yum install mod_dav_svn subversion Sample Output: ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: mod_dav_svn x86_64 1.7.14-6.el7 base 101 k subversion x86_64 1.7.14-6.el7 base 1.0 M Installing for dependencies: apr x86_64 1.4.8-3.el7 base 103 k apr-util x86_64 1.5.2-6.el7 base 92 k httpd x86_64 2.4.6-18.el7.centos updates 2.7 M httpd-tools x86_64 2.4.6-18.el7.centos updates 77 k mailcap noarch 2.1.41-2.el7 base 31 k neon x86_64 0.30.0-3.el7 base 165 k pakchois x86_64 0.4-10.el7 base 14 k subversion-libs x86_64 1.7.14-6.el7 base 921 k Transaction Summary ================================================================================ 2 – Add this config file to apacheLoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNParentPath /var/www/unixmensvn AuthType Basic AuthName "Subversion repositories" AuthUserFile /etc/svn-auth-users Require valid-user </Location> 3 – Create SVN users[root@unixmen-centos7 ~]# htpasswd -cm /etc/svn-auth-users testuser1 New password: Re-type new password: Adding password for user testuser1 [root@unixmen-centos7 ~]# 4 – Create and configure SVN repositorymkdir /var/www/unixmensvn cd /var/www/unixmensvn svnadmin create repo chown -R apache.apache repo# If you still have issues with SELinux Security please apply this: chcon -R -t httpd_sys_content_t /var/www/unixmensvn/repo chcon -R -t httpd_sys_rw_content_t /var/www/unixmensvn/repo 5 – You can open the http and https on the file with this wayfirewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --reload 6 – Enable and start the http servicessystemctl enable httpd.service systemctl restart httpd.service
7 – Secure your repository with adding this to conf/svnserve.confanon-access = none auth-access = authz 8 – Make trunk, branches and tags structure under repomkdir -p /tmp/svn-structure-template/{trunk,branches,tags} svn import -m "Initial repository" /tmp/svn-structure-template file:///var/www/unixmensvn/repo/ Adding /tmp/svn-structure-template/branches Adding /tmp/svn-structure-template/tags Adding /tmp/svn-structure-template/trunk Committed revision 1. Done!!
That’s it. Cheers! (责任编辑:IT) |