[CentOS] CentOS - Install Subversion - SVN

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
</Location>

#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

or

/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.

 

http://myhosting.com/kb/admin/media_store/2/AA-04992/centos.JPG

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/ http://168.144.83.195 /svn/ostechnix_repo/

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

http://myhosting.com/kb/admin/media_store/2/AA-04992/centos2.JPG

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

 

 

 

Was this article helpful?
0 out of 0 found this helpful