CentOS - Install Subversion - SVN
Authorsupport support Article Reference NumberAA-04992 Views3666

Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed under an open source license. Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.

Install Subversion on CentOS 6

# Install Subversion by running the command below. If Apache is not installed, it will also be installed by the same command.

yum install -y subversion mod_dav_svn

# Edit the subversion config file ‘/etc/httpd/conf.d/subversion.conf’

vi /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

#Add the following lines or comment them out. 

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user

#Create a User

htpasswd -cm /etc/svn-auth-users testuser
New password: 
Re-type new password: 
Adding password for user testuser

#Create and configure Subversion Repository

Create a directory for subversion repository under ‘/var/www/’ directory.

mkdir /var/www/svn
cd /var/www/svn/
svnadmin create ostechnix_repo
chown -R apache.apache ostechnix_repo/

#Start/Restart Apache

/etc/init.d/httpd start


/etc/init.d/httpd restart

Test Subversion

#Go to http://ip-address/svn/ostechnix_repo in your browser

# You will be prompted to login with the user that was just created.

Additional Steps

#Disable anonymous user access

#Edit the following lines  ‘ostechnix_repo/conf/svnserve.conf’ file. 

vi /var/www/svn/ostechnix_repo/conf/svnserve.conf 
## Line no 12 - Uncomment and Change to 'none' ##
anon-access = none
## Line No 27 - Uncomment to enable acess control ##
authz-db = authz

#Create some sample directories in any place and import them to your Subversion repository.

mkdir subversion-templates
cd subversion-templates/
mkdir softwares
mkdir updates
mkdir fixes

#Import the sub directories using the command ‘svn import’.

svn import -m 'Initial import' subversion-templates/ /svn/ostechnix_repo/

Adding         subversion-templates/updates
Adding         subversion-templates/softwares
Adding         subversion-templates/fixes

For more info please see: http://subversion.apache.org/

Quick Jump Menu
Subscribe to updates Subscribe to Updates
Email to a frien Email to a Friend
Print Print Article