Make sure you should login as root:–
[root@linux10 ~]#apt-get install apache2
[root@linux10 ~]#apt-get install subversion libapache2-svn
The next command is configure the user access for subversion.
[root@linux10 ~]#htpasswd -c /etc/subversion/passwd username
Where username is a new user. All subsequent users are created by doing the following
[root@linux10 ~]#htpasswd /etc/subversion/passwd username
It is important to note if you have the ‘-c’ command it WILL overwrite the existing user file. So run this command only first time.
Now you need to decide where you want to put your repositories. I suggest you put them all under one root path, for example /srv/svn/yourproject. For each repository you want create a new folder in the svn root folder and then run the following command to turn it into a repository.
[root@linux10 ~]#mkdir /srv/svn/
[root@linux10 ~]#mkdir /srv/svn/yourproject/
[root@linux10 ~]#svnadmin create /srv/svn/yourproject
We are going to use apache to serve the repositories so we need to make the svn root folder and all subsequent child files and folders accessable by apache. This is done by using the following command
[root@linux10 ~]#chown -R www-data:www-data /srv/svn/yourproject
The final part to getting repositories to be accessed from a web address add the following code to your sites apache config file located in /etc/apache2/mods-enabled/dav_svn.conf
[root@linux10 ~]#vi /etc/apache2/mods-enabled/dav_svn.conf
AuthName “yourproject Repository”
The last thing to do is restart apache after saving the file
[root@linux10 ~]#/etc/init.d/apache2 restart
After browsing your project, If you have promte for user name and password that means you have done successfully.