A quick SVN repository set up for your website

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

A quick SVN setup example.

  • choose a location where your SVN server will keep data – for example, /srv/svn; use svnadmin create a SVN project structure there:
# mkdir /srv/svn
# cd /srv/svn
# svnadmin create yoursite.example.com
  • now, import your initial version of the website:
# svn --message "Initial import" import /home/yoursite.example.com/public_html file:///srv/svn/yoursite.example.com
Adding /home/yoursite.example.com/public_html/index.html
Committed revision 1.
  • add users – first, in /srv/svn/yoursite.example.com/conf/passwd:
[users]
svnadmin = secretpass
  • and in /srv/svn/yoursite.example.com/conf/authz:
[groups]
full = svnadmin, someotheruser
read = readonlyuser
[/]
@full = rw
@read = r
  • in /srv/svn/yoursite.example.com/conf/svnserve.conf, use setting like these:
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
  • start SVN daemon:
svnserve -r /srv/svn -d
  • from a separate PC, try to checkout:
svn --username svnadmin co svn://yourserver/yoursite.example.com