Install SVN Server
sudo apt-get update
sudo apt-get install subversion
sudo apt-get install apache2
sudo apt-get install libapache2-svn
Create SVN user group and add www-data group to this group
sudo addgroup subversion
sudo usermod -G subversion -a www-data
Create SVN folder
sudo mkdir /home/svn
Create SVN repository
cd /home/svn
sudo mkdir <repository_name>
sudo c
hown root:subversion <repository_name>
sudo chmod -R g+rws <repository_name>
Configure SVN
configure dav_svn.conf
vim /etc/apache2/mods-available/dav_svn.conf
#open the element "<Location /svn>" And "DAV svn"
#open the element "SVNParentPath" and change the value to /home/svn
#open element "AuthType Basic"
#open element 'AuthName "Subversion Repository'
#open element "AuthUserFile" and change the value to /etc/subversion/dav_svn.passwd
#open element "AuthzSVNAccessFile" and change the value to /etc/subversion/dav_svn.authz
configure dav_svn.passwd add one user jason
sudo htpasswd -c /etc/subversion/dav_svn.passwd jason
#continue to add new user without parameter -c
sudo htpasswd /etc/subversion/dav_svn.passwd salk
configure dav_svn.authz
vim /etc/subversion/dav_svn.authz
#fill below file content
[groups]
administrator=jason,salk
[<repository_name>:/]
@administrator=rw
Restart SVN server and Apache2
killall svnserve
svnserve -d -r /home/svn/
sudo a2enmod authz_svn
sudo /etc/init.d/apache2 restart
Issue List
Title | Solution |
---|---|
Change apache2 port | modify file “/etc/apache2/ports.conf” |
Invalid command ‘AuthzSVNAccessFile’, perhaps misspelled or defined by a module not included in the server configuration | execute “sudo a2enmod authz_svn” |
Access link | http://hostname:port/svn/reposity_name |
Reference
在centos环境搭建svn服务器https://www.howtoforge.com/tutorial/how-to-setup-a-svn-server-on-centos-6/