= TolkienSetupSvn = This TolkienSetup sub-guide describes the steps necessary to make the computer a [http://subversion.tigris.org/ Subversion] server. == Installing Apache == Apache is required to host SVN. If you selected the "LAMP server" task during OS install, this should already be installed. To verify, run the following command: {{{ $ tasksel --list-tasks | grep lamp }}} To see the packages installed for the task, run: {{{ $ tasksel --task-packages lamp-server }}} To specifically check whether or not the `apache2` package is installed, run: {{{ $ apt-cache policy apache2 }}} If you need to install this task, run: {{{ # tasksel install lamp-server }}} If the `/etc/apache2/apache-logins.passwd` file does not already exist, create it with a user `apacheadmin` (be sure to make a note of this new username and password): {{{ # htpasswd -cm /etc/apache2/apache-logins.passwd apacheadmin }}} == Installing Subversion == Run the following command to install and enable SVN (as hosted by Apache): {{{ # apt-get install subversion libapache2-svn # a2enmod dav_svn # a2enmod auth_basic # a2enmod authn_file # a2enmod authz_user }}} Create the parent folder for SVN repos: {{{ # mkdir /var/lib/svn # chown -R root:www-data /var/lib/svn }}} Reload Apache's configuration: {{{ # /etc/init.d/apache2 force-reload }}} === Creating an SVN Repository === Do the following to create a `foo` repository: 1. Create the repository: {{{ # svnadmin create /var/lib/svn/foo }}} 1. Edit the `/etc/apache2/mods-available/dav_svn.conf` file and add the following to the end: {{{ DAV svn SVNPath /var/lib/svn/foo AuthType Basic AuthName "Subversion Repository: foo" AuthUserFile /etc/apache2/apache-logins.passwd # Allow anonymous reads but require authentication for writes/modifications: Require valid-user }}} 1. Reload Apache's configuration: {{{ # /etc/init.d/apache2 force-reload }}}