sudo apt-get install subversion libapache2-svnWe’re going to create the subversion repository in /svn, although you should choose a location that has a good amount of space.
sudo svnadmin create /svnNext we’ll need to edit the configuration file for the subversion webdav module. You can use a different editor if you’d like.
sudo gedit /etc/apache2/mods-enabled/dav_svn.confThe Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn
The DAV line needs to be uncommented to enable the dav module
# Uncomment this to enable the repository, DAV svnThe SVNPath line should be set to the same place your created the repository with the svnadmin command.
# Set this to the path to your repository SVNPath /svnThe next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to� probably best to leave it at the default.
# Uncomment the following 3 lines to enable Basic Authentication AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwdTo create a user on the repository use, the following command:
sudo htpasswd2 -cm /etc/apache2/dav_svn.passwdNote that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn�t recreate the file. Example:
sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd firedog New password: Re-type new password: Adding password for user firedogRestart apache by running the following command:
sudo /etc/init.d/apache2 restartNow if you go in your browser to http://www.server.com/svn, you should see that the repository is enabled for anonymous read access, but commit access will require a username. [img=317] If you want to force all users to authenticate even for read access, add the following line right below the AuthUserFile line from above. Restart apache after changing this line.
Require valid-userNow if you refresh your browser, you’ll be prompted for your credentials: [img=316] You now have a working subversion server! I have followed the above tutorial and installed SVN server on my home Ubuntu computer without problems. Hopefully this article can help someone else who needs help.