Installing Subversion version 1.6.11 on Centos 6.4





  • Subversion is a free open source version control system
  • Purpose of Subversion is used to manage files and directories and also controls the changes made by all users at particular point of time .
  • Subversion would also allows us to recover the older files and directories and also we can compare the older files with the existing files


Install SVN, version 1.6.11

[root@SERVER /]# yum install -y subversion mod_dav_svn


To check the SVN version

[root@SERVER /]# svn –version


Configuration of SVN

[root@SERVER /]# vi /etc/httpd/conf.d/subversion.conf


Add the following lines on Subversion.conf at line 4


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

It should look like this.

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 repositories"
AuthUserFile /etc/svn-users
Require valid-user
</Location>
#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be both:
#
# a) readable and writable by the 'apache' user, and
#
# b) labelled with the 'httpd_sys_content_t' context if using
# SELinux


Now create a new user for Subversion called 'test'.

For the first User make use of -cm
[root@server ~]# htpasswd -cm /etc/svn-users test
New password:
Re-type new password:
Adding password for user test

From Second Users On-words make use of -m
[root@server ~]# htpasswd -m /etc/svn-users test1
New password:
Re-type new password:  Adding password for user test1

To check the users created for SVN 

[root@server ~]#cat /etc/svn-users
test:$AHGDSHUElF78FDSERrfewjedfrg
test1:$ADSRrGFWERBASKSHDHjdfrg/

Create the directory called SVN 

[root@server ~]# mkdir /var/www/svn
[root@server ~]# cd /var/www/svn/

Configure Subversion Repository 

[root@server svn]# svnadmin create production
[root@server svn]# chown -R apache.apache production/


Check that apache default port ’80′ is opened through iptables.

[root@server svn]# vi /etc/sysconfig/iptables
-A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT

Now restart iptables to save the above changes.

[root@server svn]# /etc/init.d/iptables restart iptables:
Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

Now Restart the Apache 

[root@SERVER ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Testing SVN 

Now go-to http://localhost/svn/production address and browser should look like this. Then enter username and password:










To disable anonymous access and enable access control 

edit the following line in ‘production/conf/svnserver.conf’ file.
[root@server ~]# vi /var/www/svn/production/conf/svnserve.conf
change anon-access = read
 to
anon-access = none
And also Uncomment to enable acess control
authz-db = authz

Create trunkbranches and tags structure under production

Create “template” directories with following command:
[root@server ~]#cd tmp
[root@server tmp]# mkdir svn-temp
[root@server tmp]# cd svn-temp
[root@server svn-temp]# mkdir trunk
[root@server svn-temp]# mkdir branches
[root@server svn-temp]# mkdir tags

Now import the sub directories using the command ‘svn import’.


[root@server ~]# svn import -m 'Initial import' svn-temp/ http://localhost/svn/production/
Adding svn-temp/trunk
Adding svn-temp/tags
Adding svn-temp/branches

Committed revision 2.

Now go-to http://localhost/svn/production once the username and password is entered in the browser it would look like this.








Comments

Post a Comment

Popular posts from this blog

Using Redis in PHP for handling background Jobs

DrillDown using Flot Charts

Securely setting Files and Folder permissions on Laravel 5