Skip to content

karippery/Apache-SVN-syncronization-master-slave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Apache-SVN-syncronization-master-slave

SVN REPOSITORY SERVER AND SYNCHRONIZATION

Install SVN on all your Debian 9 server


apt-get install apache2 subversion libapache2-mod-svn libsvn-dev

Create First SVN Repository


mkdir -p /var/lib/svn/
svnadmin create /var/lib/svn/myrepo
chown -R www-data:www-data /var/lib/svn
chmod -R 775 /var/lib/svn

Create Users for Subversion


touch /etc/apache2/dav_svn.passwd
htpasswd -m /etc/apache2/dav_svn.passwd admin
New password:
Re-type new password:

htpasswd -m /etc/apache2/dav_svn.passwd user1
New password:
Re-type new password:

Configure Apache with Subversion

on file /etc/apache2/mods-enabled/dav_svn.conf




   DAV svn
   SVNParentPath /var/lib/svn

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd
   Require valid-user
     

restart the Apache service to apply the new configuration


service apache2 restart

Access Repository in Browser

[[http://***.168.56.129/svn/myrepo/]]

Import Project to the SVN Repository

Create a new svn-templates project directory.


mkdir -p ~/svn-templates/{trunk,branches,tags}

Add templates directory to the repository using the svn command below.


 svn import -m 'Initial import' ~/svn-templates/ file:///var/lib/svn/myrepo/ --username admin --password Qwe12345!

nano /var/lib/svn/myrepo/hooks/pre-revprop-change on master


#!/bin/sh
REVISION=${2}
# Launch (backgrounded) sync jobs for each slave server.
svnsync copy-revprops http://**.226.179.206/svn/myrepo ${REVISION} &
svnsync copy-revprops http://**.226.179.207/svn/myrepo ${REVISION} &
exit 0

nano /var/lib/svn/myrepo/hooks/post-commit on master


#!/bin/sh
# Launch (backgrounded) sync jobs for each slave server.
svnsync sync --username admin --password Qwe12345! http://**.226.179.206/svn/myrepo &
svnsync sync --username admin --password Qwe12345! http://**.226.179.207/svn/myrepo &

chmod +x /var/lib/svn/myrepo/hooks/pre-revprop-change on master

chmod +x /var/lib/svn/myrepo/hooks/post-commit on master


svnsync init  --username admin --password Qwe12345!   http://**.226.179.208/svn/myrepo  --allow-non-empty   file:///var/lib/svn/myrepo/ ${REVISION}
svnsync init  --username admin --password Qwe12345!   http://**.226.179.206/svn/myrepo  --allow-non-empty   file:///var/lib/svn/myrepo/ ${REVISION}
 svnsync init  --username admin --password Qwe12345!   http://**.226.179.207/svn/myrepo  --allow-non-empty   file:///var/lib/svn/myrepo/ ${REVISION}
svnsync sync --username admin --password Qwe12345! http://**.226.179.207/svn/myrepo
svnsync sync --username admin --password Qwe12345! http://**.226.179.206/svn/myrepo

About

SVN REPOSITORY SERVER AND SYNCHRONIZATION

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published