sudo apt-get install subversion libapache2-svn
sudo svnadmin create /svn
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://128.143.XX.XX/svn
In the file uncomment the following lines
<Location /svn> DAV svn #The 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 SVNParentPath /svn # Uncomment the following 3 lines to enable Basic Authentication AuthType Basic AuthName “Subversion Repository” AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user ## add this line
sudo htpasswd -cm /etc/apache2/dav_svn.passwd <username>
Type in password when required.
sudo htpasswd -m /etc/apache2/dav_svn.passwd <username>
Type in password when required.
sudo /etc/init.d/apache2 restart
$ svnadmin create /svn/repos1
on the server
svn checkout http://128.143.XX.XX/svn/repos1
nano test.txt
svn add test.txt
svn commit test.txt -m "Initial readme file"
sudo apt-get install viewvc
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Add the following line in the file
ScriptAlias /viewvc /usr/lib/cgi-bin/viewvc.cgi
at the end of the file
/etc/viewvc/viewvc.conf
Change the root_parents to
root_parents = /svn : svn
sudo /etc/init.d/apache2 restart
http://128.143.XX.XX/viewvc/viewvc.cgi
By default, anyone can access ViewVC. To control access using the rules for svn. Open the svn configure file using
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
and add the following at the end
<Location /viewvc> AuthType Basic AuthName "ViewSVN" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location>