Tutorials and How-tos/Install Subversion with Apache

From BubbaWiki
< Tutorials and How-tos
Revision as of 17:39, 28 October 2010 by Johan Lind (talk | contribs) (Created page with 'How to install Subversion (SVN) with Apache on your Bubba server Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac & Linux open a terminal and write s...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How to install Subversion (SVN) with Apache on your Bubba server


Log in to your Bubba server using SSH (On Windows use PuTTY and on Mac & Linux open a terminal and write ssh).

Gain root access (Linux talk for admin rights) with default password excito.
su

Change directory to /
cd /

First we need to install the actual SVN software from the repository.
We will use the default repository and install the version available there 1.5.1

apt-get install subversion
apt-get install libapache2-svn

mkdir /var/svn
chown -R www-data:www-data /var/svn

nano /etc/apache2/mods-available/dav_svn.conf
cat /etc/apache2/mods-available/dav_svn.conf

/etc/init.d/apache2 restart
first user
htpasswd -cm /etc/apache2/dav_svn.passwd user1
next user
htpasswd -m /etc/apache2/dav_svn.passwd user2

svnadmin create /var/svn/test
chown -R www-data:www-data /var/svn/test


# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# configuration in /etc/apache2/sites-available/*, not here.

  1. <Location URL> ... </Location>
    # URL controls how the repository appears to the outside world.
    # In this example clients access the repository as http://hostname/svn/
    # Note, a literal /svn should NOT exist in your document root.
    <Location /svn>
  1. Uncomment this to enable the repository
    DAV svn
  1. Set this to the path to your repository
    #SVNPath /var/lib/svn
    # Alternatively, use SVNParentPath if you have multiple repositories under
    # under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
    # You need either SVNPath and SVNParentPath, but not both.
    SVNParentPath /var/svn
    SVNListParentPath on
    # Access control is done at 3 levels: (1) Apache authentication, via
    # any of several methods. A "Basic Auth" section is commented out
    # below. (2) Apache <Limit> and <LimitExcept>, also commented out
    # below. (3) mod_authz_svn is a svn-specific authorization module
    # which offers fine-grained read/write access control for paths
    # within a repository. (The first two layers are coarse-grained; you
    # can only enable/disable access to an entire repository.) Note that
    # mod_authz_svn is noticeably slower than the other two layers, so if
    # you don't need the fine-grained control, don't configure it.
  1. Basic Authentication is repository-wide. It is not secure unless
    # you are using https. See the 'htpasswd' command to create and
    # manage the password file - and the documentation for the
    # 'auth_basic' and 'authn_file' modules, which you will need for this
    # (enable them with 'a2enmod').
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
  1. To enable authorization via mod_authz_svn
    #AuthzSVNAccessFile /etc/apache2/dav_svn.authz
  1. The following three lines allow anonymous read, but make
    # committers authenticate themselves. It requires the 'authz_user'
    # module (enable it with 'a2enmod').
    #<LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
    #</LimitExcept>

</Location>