miércoles, noviembre 03, 2004

Subversion

Well, I've finally learned how to set up a subversion repository, browseable through http (WebDAV, as a matter of fact).



I installed it in my SuSE Linux 9.1 professional workstation, but it should be simple to repeat the procedure in other distros as well.



Packages that should be installed:



  • apache2

  • subversion

  • subversion-server

  • subversion-viewcvs



In order to access the repository through http, it is needed that the apache ServerName directive matches the URL. If the machine is used for something besides SVN, and it is not possible to use ServerName at a global level, a virtual host is going to be needed.



In /etc/sysconfig/apache2 the line APACHE_MODULES must contain the words dav and dav_svn.



I edited the /etc/apache2/conf.d/subversion.conf file to read like this:




# Example configuration for a subversion repository

# see /usr/share/doc/packages/subversion for the full documentation

#

<IfModule mod_dav_svn.c>

<Location /repos>

 DAV svn

 SVNParentPath /srv/svn/html

 # Limit write permission to list of valid users.

 <LimitExcept GET PROPFIND OPTIONS REPORT>

  # Require SSL connection for password protection.

  # SSLRequireSSL

  AuthType Basic

  AuthName "Subversion repository"

  AuthUserFile /srv/svn/user_access/repos_passwdfile

  Require valid-user

 </LimitExcept>

</Location>

</IfModule>



Authentication permissions should be given to every user which is supposed to make changes to the repository:



# htpasswd2 -cm /srv/svn/user_access/repos_passwdfile bruno


Finally, and obviously, every repository in the machine has to be created, and permissions must be given to apache process to read and write on it:




# svnadmin create /srv/svn/html/repository
# chown -R wwwrun. /srv/svn/html/repository


And that's it! Easy, right? The repository is now accessible at http://host.your.domain.com/repos/repository

No hay comentarios: