Today I will share about how to install subversion on Ubuntu Server 14.04. Even many tutorials can be found on internet, but I create this tutorial just for my archive. You can follow the following steps:
1. Install SVN server by typing this command on Ubuntu terminal: sudo apt-get install subversion libapache2-svn apache2.

2. Make svn directory under root by typing this command: sudo mkdir /svn

3. Configure svn file by typing: sudo vim /etc/apache2/mod-enabled/dav_svn.conf. Put this line in file:
<Location /svn>
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
If you want everyone just can read without write, you have to change file to be the following.
<Location /svn>
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
4. We create svn user by typing this command: sudo htpasswd -cm /etc/apache2/dav_svn.passwd user. You will be asked to input new password and keep the password for login later.
If you want to create new user, you only need to type sudo htpasswd -m /etc/apache2/dav_svn.passwd newuser. If you type sudo htpasswd -cm /etc/apache2/dav_svn.passwd newuser, it will replace old file with new file so that there only has one user.
5. We can test our svn server by creating new project inside /svn directory by typing: sudo svnadmin create kaldi_repo
6. Make sure we can the permission of /svn directory to apache by typing: sudo chown -R www-data:www-data /svn
7. Restart apache2 server by typing: sudo service apache2 restart






No comments:
Post a Comment