Friday, 14 July 2017

SVN Source Code repository Installation in Linux (Centos7)



Step 1 : (subversion installation)

# sudo yum install mod_dav_svn subversion

Step 2 : (Authentication file and data path configuration) 

# sudo vi /etc/httpd/conf.d/subversion.conf

Add following lines

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

Step 3 : (create first user for the repository)

# sudo htpasswd -m /etc/svn-auth-users name1

New password: *******
Re-type new password: ******

//Adding password for user name1

Step 4 :  (create trunk, branch and tags repo)

# sudo svnadmin create repos
# sudo service httpd restart
# cd /tmp
# sudo mkdir mytestproj
# cd mytestproj
# sudo mkdir trunk branch tags

Step 5 : (Create your first project repository )

# sudo mkdir /var/www/svn/
# sudo svnadmin create /var/www/svn/test
# sudo svn import -m "Initial repository" /tmp/mytestproj file:///var/www/svn/test
# sudo chown -R apache.apache /var/www/svn/test/
# sudo chcon -R -t httpd_sys_content_t /var/www/svn/test
# sudo chcon -R -t httpd_sys_rw_content_t /var/www/svn/test
# sudo systemctl reload httpd.service


Successfully Installed SVN source code repository in your centos machine. 

your test project repository URL will be http://your_centos_ip/svn/test/

Note : 

* If you  want to create Next project repository, you just follow Step 5 only.
* If you want to create more than one users for the repository you just enter this command 

sudo htpasswd -c /etc/svn-auth-users name1

***********************************Thank You****************************************