1. Change root user
su -
## OR ##
sudo -i
|
2. Install needed packages (mod_dav_svn and subversion)
yum install mod_dav_svn subversion
|
3. Modify Subversion config file /etc/httpd/conf.d/subversion.conf
Add following config to /etc/httpd/conf.d/subversion.conf file:LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so |
4. Add SVN (Subversion) users
Use following command:## Create testuser ##
htpasswd -cm /etc/svn-auth-users testuser
New password:
Re-type new password:
Adding password for user testuser
## Create testuser2 ##
htpasswd -m /etc/svn-auth-users testuser2
New password:
Re-type new password:
Adding password for user testuser2
|
Read more SVN Access Control >>
5. Create and configure SVN repository
mkdir /var/www/svn
cd /var/www/svn
svnadmin create testrepo
chown -R apache.apache testrepo
## If you have SELinux enabled (you can check it with "sestatus" command) ##
## then change SELinux security context with chcon command ##
chcon -R -t httpd_sys_content_t /var/www/svn/testrepo
## Following enables commits over http ##
chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo
|
/etc/init.d/httpd restart
## OR ##
service httpd restart
|
SVN testrepo revision 0:
6. Configure repository
To disable anonymous access and enable access control add following rows to testrepo/conf/svnserve.conf file:## Disable anonymous access ##
anon-access = none
## Enable access control ##
authz-db = authz
|
7. Create trunk, branches and tags structure under testrepo
Create “template” directories with following command:mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}
|
svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Adding /tmp/svn-structure-template/trunk
Adding /tmp/svn-structure-template/branches
Adding /tmp/svn-structure-template/tags
Committed revision 1.
|
No comments:
Post a Comment