Friday, September 5, 2014

Install SVN on RedHat Linux RHEL and configure DepSync on WSO2 worker manager nodes

  • After loggin in change the user into root user 
    • sudo -i 
  • You can install required packages using (This command will install Apache if its not already installed)
    • yum install mod_dav_svn subversion 
  • After this step SVN will be installed in the server and now we can configure it :) 
    • Navigate to /etc/httpd/conf.d/subversion.conf and modify it as below

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so<Location /svn>
<Location>
   DAV svn
   SVNParentPath /var/www/svn
   AuthType Basic
   AuthName "Subversion repositories"
   AuthUserFile /etc/svn-auth-users
   Require valid-user
</Location>
  • You can create SVN users using following commands 
    • htpasswd -cm /etc/svn-auth-users testuser
  • This will request password for for the user
  • Now finally since we sucessfully installed SVN created SVN user next we can create the repository :) 
    • mkdir /var/www/svn
    • cd /var/www/svn
    • svnadmin create mySvnRepo
    • chown -R apache.apache mySvnRepo
  • Next we need to restart the Apache server 
    • service httpd restart
Goto http://localhost/svn/mySvnRepo address using your browser. Now by giving the SVN user credentials you can login to the repo and view the content.


Once you provided the credentials you will be able to check the your repository and the content if any,


    Now lets configure WSO2 servers as Manager and Workers

Enabling DepSync on the manager node

You can configure DepSync in the /repository/conf/carbon.xml file on the manager node by making the following changes,

<DeploymentSynchronizer>
    <Enabled>true</Enabled>
    <AutoCommit>true</AutoCommit>
    <AutoCheckout>true</AutoCheckout>
    <RepositoryType>svn</RepositoryType>
    <SvnUrl>http://localhost/svn/mySvnRep/</SvnUrl>
    <SvnUser>testuser</SvnUser>
    <SvnPassword>testpass</SvnPassword>
    <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>

Enabling DepSync on the worker nodes

In worker node you need to set the AutoCommit property to false as below,

<DeploymentSynchronizer>
    <Enabled>true</Enabled>
    <AutoCommit>false</AutoCommit>
    <AutoCheckout>true</AutoCheckout>
    <RepositoryType>svn</RepositoryType>
    <SvnUrl>http://localhost/svn/mySvnRep/</SvnUrl>
    <SvnUser>testuser</SvnUser>
    <SvnPassword>testpass</SvnPassword>
    <SvnUrlAppendTenantId>true</SvnUrlAppendTenantId>
</DeploymentSynchronizer>

[1] https://docs.wso2.com/display/CLUSTER420/SVN-based+Deployment+Synchronizer
[2] www.if-not-true-then-false.com/2010/install-svn-subversion-server-on-fedora-centos-red-hat-rhel

No comments:

Post a Comment