SVN installation (Linux VPS/Cloud) Apache 2.2

  1. Via SSH on your server execute the following command to install SVN:  

# yum install subversion

  1. Check if dav modules are loaded:

`/etc/init.d/httpd -M | grep dav

dav_module (static)
dav_fs_module (static)
dav_lock_module (static)
dav_svn_module (shared)`

If this modules are missing you need to rebuild apache using /scripts/easyapache.

  1. Select the profile that you wish to modify
  2. Click Next Step in the Apache Version stage
  3. Click Next Step in the PHP Version stage
  4. Click Exhaustive Options List
  5. Perform one of the following actions in the Exhaustive Options List:
  • To install the mod\_dav Apache module, select the Dav option.
  • To install the mod\_davz Apache module, select the Davz option.
  1. Click Save and Build.

Also make sure whether neon installed or not, if not installed:

http://www.webdav.org/neon/neon-0.28.4.tar.gz

tar -xzvf neon-0.28.4.tar.gz cd neon-0.28.4 ./configure --prefix=/usr/local/neon

  1. Install and configure SVN. Execute the commands via SSH:

wget http://subversion.tigris.org/downloads/subversion-1.6.3.tar.bz2 tar xfj subversion-1.6.3.tar.bz2 wget http://www.sqlite.org/sqlite-amalgamation-3.7.0.tar.gz tar -zxvf sqlite-amalgamation-3.7.0.tar.gz cd subversion-1.6.3 mkdir sqlite-amalgamation cp /usr/src/sqlite-3.7.0/sqlite3.c /usr/src/subversion-1.6.3

  1. Configure the subversion.

Check the apr source directory. Usually it is: /home/cpeasyapache/src/httpd-2.2/srclib/apr/.

Execute:

./configure --prefix=/usr/local/subversion --with-apr=/home/cpeasyapache/src/httpd-2.2/srclib/apr/ --with-apr-util=/home/cpeasyapache/src/httpd-2.2/srclib/apr-util/ --with-neon=/usr/local/neon make make install

  1. Create SVN for cpanel user:

`mkdir -v /home/user/directory/repository

/usr/bin/svnadmin create --fs-type fsfs /usr/local/subversion/repository`

That should create a subversion repository under /usr/local/subversion/repository.

  1. Fix permissions for the created directory:

chown -R user:nobody /home/user/dir/repository chmod -R 770 /home/user/dir/repository

Put the following entries in /usr/local/apache/conf/userdata/std/2/user/domain/svn.conf

DAV svn SVNListParentPath On SVNPath /home/user/directory/repository AuthType Basic AuthName "Subversion repository" AuthUserFile /home/user/directory/repository/conf/authz Require valid-user

Save it.

Then run:

/scripts/ensure\_vhost\_includes --user=username

  1. Adding SVN users:

`htpasswd -cmd /home/user/directory/repository/conf/auth username

  1. Access the svn using link http://domain.com/svn`