Setting up svn server on Ubuntu 11.04, VPS
Hi again after a long long long time I decided to send a new post! surprise surprise…
recently i again started playing with vps an needed to install svn server. as my clumsy friend huseyin massed up with permissions i wanted this post to stay in my blog so he can open and remember how to install svn server whenever he wants! (as far as he is online :))
first of all it should be noted that ubuntu is installed on a VPS and I connect it via a ssh client as ‘root’, but still I’ll use sudo for the sake of the post. My name is UMUT so I will create UMUT for the username and HUSEYIN for my clumsy friens, besides I will create the repository in /home/svn and only users with permissions can access to the repo.
here are the shell commands:
sudo apt-get update
sudo apt-get install nano apache2 subversion libapache2-svn
- at this point it may ask you if you really want to install the packages, asnwer yes by pressing ‘Y’
htpasswd -cm /etc/apache2/dav_svn.passwd UMUT
- we created the file, it will ask you the password here, type the password
htpasswd -m /etc/apache2/dav_svn.passwd HUSEYIN
- as the file is created we dont put -cm but -c instead, it will ask for the pass of HUSEYIN, again type the pass,
nano /etc/apache2/dav_svn.authz
- copy and past the following 2 lines in order to give the read/write permission to everyone logged in the svn, and then ctrl+o to save and ctrl+x to exit
[/]
* = rw
svnadmin create /home/svn
nano /etc/apache2/mods-enabled/dav_svn.conf
- a long file will show up, we need to uncomment (delete # ‘s) the following lines
<Location /svn>
DAV svn
SVNPath /home/svn
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /etc/apache2/dav_svn.passwd
AuthzSVNAccessFile /etc/apache2/dav_svn.authz
Require valid-user
# SVNAutoversioning on
# Satisfy Any
</Location>
cd /home/svn
mkdir dav
chmod -R 770 ./*
chown -R www-data:www-data ./*
/etc/init.d/apache2 restart
keep in mind that you need to enter http://ip_or_site_name/svn as we defined in/etc/apache2/mods-enabled/dav_svn.conf
that’s all hope it works