Friday, March 1, 2013

Subversion installation and configuration

Install Subversion
First of all make sure whether these modules are available, if it's not there, do the needful.
#httpd -M | grep dav

dav_module (static)
dav_fs_module (static)
dav_lock_module (static)
dav_svn_module (shared)
Also make sure whethe 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
installation
[/usr/src]# wget 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


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

make
make install

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.
ls /usr/local/subversion/repository

conf/ dav/ db/ format hooks/ locks/ README.txt
You should be able to see those files under the repository 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
Adding SVN users:
htpasswd -cmd /home/user/directory/repository/conf/auth username
Setting up the initial repository layout:
A repository mostly contains 3 standard folders.
branches
tags
trunk
For creating those standard folders in a repository, create a temporary folder anywhere you want, /tmp would be a good idea, with the following subdirectories.
mkdir -pv /tmp/subversion-layout/{branches,tags,trunk} touch /tmp/subversion-layout/trunk/test.html

/usr/local/subversion/bin/svn import /tmp/subversion-layout/ http://domain.com/dir

For reference
http://sven.webiny.com/subversion-on-cpanel-3-with-centos-55-and-easyapache-32/
http://www.howtoforge.com/apache_subversion_repository

No comments:

Post a Comment