Setting up WebSVN

Install subversion (and all dependencies):

yum install subversion

Create a new directory for WebSVN to live in, e.g. /var/www/websvn. Check out the latest version of WebSVN from the repository:

svn checkout http://websvn.tigris.org/svn/websvn/trunk websvn --username guest

Change the ownership of the websvn folder to apache:

chown apache:apache -R /var/ww/websvn

Change the permissions on the /var/ww/websvn/cache directory to 777

chmod 777 -R /var/www/websvn/cache

Move /var/www/websvn/include/distconfig.php to /var/www/websvn/include/config.php. Edit the following lines in /var/www/websvn/include/config.php:

$config->parentPath('/home/svn');
$config->useMultiViews();
$config->useEnscript();
// $config->setTemplatePath("$locwebsvnreal/templates/calm/");
$config->setTemplatePath("$locwebsvnreal/templates/BlueGrey/");

Copy /var/www/websvn/wsvn.php to /var/www/<html_root>, and edit the following lines:

$locwebsvnhttp = "/websvn";
$locwebsvnreal = "/var/www/websvn"

Create the root directory for your SVN repositories to live in (e.g. /home/svn). At the same time, check that the htpasswd directory (/var/www/passwd) exists, and create a new htpasswd for websvn:

htpasswd -cm /var/www/passwd/svn-auth-file <username>

Install the DAV SVN Apache module (and all it’s dependencies):

yum install mod_dav_svn

Create a new configuration file: /etc/httpd/conf.d/subversion.conf:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
 
    DAV svn
    SVNParentPath /home/svn
    AuthType Basic
    AuthName "PJLewis.org Subversion Repository"
    AuthUserFile /var/www/passwd/svn-auth-file
    Require valid-user

Create another new configuration file: /etc/httpd/conf.d/wsvn.conf:

Alias /websvn/templates/ "/var/www/websvn/templates/"
 
    DAV svn
    SVNParentPath /home/svn
    AuthType Basic
    AuthName "PJLewis.org Subversion Repository"
    AuthUserFile /var/www/passwd/svn-auth-file
    Require valid-user
 
&lt;Directory "/var/www/websvn/templates/"&gt;
    Options FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

Restart Apache, and browse to http://<domain.com>/wsvn/

Leave a Reply

Your email address will not be published. Required fields are marked *