Monday, August 19, 2013
1:26 PM

Configration of SVN Server on CentOS/RHEL 5/6, Fedora (Subversion)


Subversion (SVN) is an open source version control system. It helps you keep track of a collection of files and folders. Any time you change, add or delete a file or folder that you manage with Subversion, you commit these changes to your Subversion repository, which creates a new revision in your repository reflecting these changes. You can always go back, look at and get the contents of previous revisions.
This article will help you for step by step installing SVN server.
Step 1: Install Apache/PHP Packages
You need to install apache web server to access svn server using http urls.
# yum install httpd php php-devel php-cli php-pear
Start Apache web server and setup to auto start on system boot
# service httpd restart
# chkconfig httpd on
Step 2: Install Subversion Using Yum
Use following command to install subversion and mod_dav_svn packages.
# yum install mod_dav_svn subversion
Step 3: Configure Subversion with Apache
Subversion creates an apache configuration file, we just need to make necessary changes to it.
# vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion User Authentication "
AuthUserFile /etc/svn-users
Require valid-user
</Location>
Step 4: Create First SVN Repository
Use following command to create your fist svn repository.
# cd /var/www/svn
# svnadmin create svnrepo
# chown -R apache.apache svnrepo
Step 5: Add SVN Users
Following commands will add two users for svn. It will prompt for users password to be assigned.
# htpasswd -cm /etc/svn-users user1
# htpasswd -m /etc/svn-users user2
Step 6: Access Your Repository in Browser
Use http urls to access your repository in browser. It will prompt for authentication. Use login credentials created in Step 5.
http://svn.linuxadmin.in/svn/svnrepo/

enter user name and password in brower.
Step 5: Adding Files to Your Repository
This step is for testing that repository is working properly. Use following commands to add few files to your svn repository.
# svn co http://svn.linuxadmin.in/svn/svnrepo/
# cd svnrepo
# touch file1.txt file2.txt
# svn add file1.txt file2.txt
# svn ci file1.txt file2.txt -m "initial commit"
Again checkhttp://svn.linuxadmin.in/svn/svnrepo/ url in browser. You will see your new files there.

0 comments:

Post a Comment