Difference between revisions of "Svn"

From CSLabsWiki
Jump to: navigation, search
(Adding a Repository: Added important permission change during creation)
(Updated for anon SVN)
Line 33: Line 33:
 
   AuthzSVNAccessFile /var/svn/conf/authz
 
   AuthzSVNAccessFile /var/svn/conf/authz
  
 +
  # try anonymous access first, resort to real
 +
  # authentication if necessary.
 +
  Satisfy Any
 
   Require valid-user
 
   Require valid-user
 
 
   # how to authenticate a user
 
   # how to authenticate a user
 
   AuthType Basic
 
   AuthType Basic
Line 41: Line 43:
 
</Location>
 
</Location>
 
</pre></code>
 
</pre></code>
 +
 
===Subversion===
 
===Subversion===
 
====Directory Structure====
 
====Directory Structure====

Revision as of 16:06, 23 December 2008

Hostname: svn.cslabs.clarkson.edu
Operating system: Ubuntu Gutsy
LDAP Support: No
Development Status: In Development
Status: Running


Svn is the virtual machine running the COSI subversion server.

Installed Packages

  • Those included in a Gutsy Debootstrap
  • emacs22-nox
  • nano
  • openssh-server
  • subversion
  • subversion-tools
  • apache2
  • libapache2-svn
  • sendmail

Configuration Files

Apache 2

/etc/apache2/httpd.conf

<Location /svn>
  DAV svn
  SVNParentPath /var/svn/repos

  # our access control policy
  AuthzSVNAccessFile /var/svn/conf/authz

  # try anonymous access first, resort to real
  # authentication if necessary.
  Satisfy Any
  Require valid-user
  # how to authenticate a user
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile /var/svn/conf/passwd
</Location>

Subversion

Directory Structure

   |var
   |-svn
   |---conf
   |---repos
   |-----REPO_1
   |-------dav
   |-------db
   |---------revprops
   |---------revs
   |---------transactions
   |-------hooks
   |-------locks
   |-----REPO_2
   |-------dav
   |-------db
   |---------revprops
   |---------revs
   |---------transactions
   |-------hooks
   |-------locks
   |-----REPO_3 ...

Authentication Files

/var/svn/conf/authz

[REPO:/path]
user = {none | r | rw}
@group = {none | r | rw}

[groups]
group = user1,user2

/var/svn/conf/passwd

An htpasswd file containing the user/password combinations for the users referenced in the above file.

Common Tasks

Adding a User

# htpasswd -m /var/svn/conf/passwd <username>
New password: <password>
Re-type new password: <password>
Adding password for user <username>

Adding a Repository

# svnadmin create /var/svn/repos/<reponame>
# chown -R www-data /var/svn/repos/<reponame>

Grant access to a User for a Repository

  • Edit the /var/svn/conf/authz file