In this article, I will mention about SubVersioN (SVN) installation on Oracle Linux Server. SVN is a type of version control system. Basically it allows a team to manage sharing a code base. Also, it allows to keep revisions of codes and enables to turn back to old code.
Let’s begin with installation.
- Install SVN packages on a RHEL based operating system:
1 |
# yum install httpd mod_dav_svn subversion |
- Below commands create a new SVN repository. Our repository name will be testRepo.
1 2 3 |
# mkdir /var/www/svn/ # cd /var/www/svn/ # svnadmin create testRepo |
- Change owner of testRepo to apache.
1 |
# chown -R apache:apache testRepo |
- Edit SVN configuration file as below.
You can change /etc/httpd/conf.d/subversion.conf file accourding to your configuration.
1 2 3 4 5 6 7 8 9 |
# vi /etc/httpd/conf.d/subversion.conf DAV svn SVNParentPath /var/www/svn AuthType Basic AuthName "Subversion repositories" AuthUserFile /etc/httpd/conf.d/svn.users AuthzSVNAccessFile /var/www/svn/testRepo/conf/authz Require valid-user |
- SVNParentPath shows path of directory of SVN Repositories.
AuthUserFile shows path of SVN users file.
AuthzSVNAccessFile shows path of SVN User and Repository authentication file.
You can create SVN users with “htpasswd” command.
If you are running this command for the first time, you should use “-cm” parameter to create a new password file.
1 2 3 4 |
# htpasswd -cm /etc/httpd/conf.d/svn.users oracle New password: Re-type new password: Adding password for user oracle |
- If you have existing users on SVN, you should use “-m” parameter to update existed password file.
1 2 3 4 |
htpasswd -m /etc/httpd/conf.d/svn.users oracle2 New password: Re-type new password: Adding password for user oracle2 |
- You can list content of password files.
1 2 |
# cat /etc/httpd/conf.d/svn.users oracle:$apr1$9t19J…$hCF2GJTlizZfnPjKyk9rk/ |
- You can authenticate users and repositories with authz file. You can change it according to your configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# vi /var/www/svn/testRepo/conf/authz ## For groups: ## group_name = svn_user [groups] developer = oracle other = onur.cinar ## For authenticating users and repositories: ## [repository_name/ path of repository directory] ## svn user or group name = (r,rw) read or read write permissions ## r = read, rw = read – write [/] @other = r @developer = rw |
- Restart Httpd service and add httpd to chkconfig
1 2 |
# /etc/init.d/httpd restart # chkconfig httpd on |