A flag icon shows that page is written in: En English, Ja Japanese

Subversion


Usage

# svnadmin create /var/svn/www

The project directory will usually contain trunk, branches, and tags subdirectories.

# svn import /home/ryu/public_html file:///var/svn/www -m "initial import"

To create a working copy of the project stored previously, you should check out the project from the repository:

$ svn checkout file:///var/svn/www/trunk ~/work/www
$ svn update
$ svn commit

WebDAV/DeltaV

DAV stands for 'Distributed Authoring and Versioning'. It implements a file server using a web server through HTTP protocol.

If you read and write a repository with HTTP scheme, you will need to enable subversion with WebDAV. You can then access the URL beginning with 'http://' to read and write the project directories.

LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
<Location /repos/www>
  DAV svn

# Auto-versioning allows generic WebDAV client to commit files
# with write request.
# SVNAutoVersioning On
# ModMimeUsePathInfo On

# SVNPath /var/svn/project
  SVNParentPath /var/svn
# SVNReposName name
# SVNIndexXSLT /svnindex.xsl
  AuthType Basic
  AuthName "Subversion repository"
  AuthUserFile /etc/svn-auth-file
</Location>

Directory Permissions

When a user commit a file through http, dav directory should automatically be created. However the parent is usually not writable from a general user. So in most cases you need to manually create the directory and give read/write permissions for www-data that is used by Apache.

# sudo chown -R www-data:www-data /var/lib/svn/db
# sudo mkdir /var/lib/svn/dav
# sudo chown -R www-data:www-data /var/lib/svn/dav

Path-based Authentication

Load 'mod_authz_svn' module from the modules directory in the Apache installation location.

LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /repos/www>
  ....
  SVNPathAuthz On
  AuthzSVNAccessFile /etc/authz-svn-access
</Loccation>

Groups, LDAP and Aliases

[groups]
calc-developers = harry, sally, joe

[calc:/projects/calc]
@calc-developers = rw
[aliases]
harry = CN=Harold Hacker,OU=Engineers,DC=red-bean,DC=com
sally = CN=Sally Swatterbug,OU=Engineers,DC=red-bean,DC=com
joe = CN=Gerald I. Joseph,OU=Engineers,DC=red-bean,DC=com

[groups]
calc-developers = &harry, &sally, &joe

Return Home En

Ryu: ryu@run.sh