How to copy Subversion repositories to another server
- Ensure you have a working Subversion installation with Apache installed on your system.
- On the source machine, dump each repository:
>svnadmin dump /path/to/repository > repository-name.dmp - Copy repository-name.dmp to the target server.
- Load the repository into the new server:
> cd /path/to/new-repository > svnadmin create repository-name > svnadmin load repository-name < repository-name.dmp - Reassign apache permissions:
>chown -R apache.apache repository-name - You are now ready to begin using your repository on the new server!
Categories: Change Management, Linux, Security Tags: Subversion
How to install Subversion with Apache HTTPD
- Ensure you have Apache installed on your system.
- Ensure you have mod_dav_svn installed:
> yum -y update mod_dav_svn
- Edit /etc/httpd/conf.d/subversion.conf and append the following lines to the end of your config file:
<Location /svn> DAV svn SVNParentPath /var/svn AuthType Basic AuthName "Subversion repository" AuthUserFile /etc/svn-auth-file AuthzSVNAccessFile /etc/svnserve.conf Require valid-user </Location>
- Create a file called /etc/svn-auth-file
Assign permission:> chown root.root /etc/svn-auth-file > chmod 644 /etc/svn-auth-file
- Add users to /etc/svn-auth-file (one per line) in the form:
tom:$apr1$hDMIx…$abctozvZbC9J6/heHBBe481You can use htpasswd to do this automatically:> ### First time: use -cm to create the file > ### Use -m to use MD5 encryption of the password, which is more secure > htpasswd -m /etc/svn-auth-file harry New password: ***** Re-type new password: ***** Adding password for user harry > htpasswd /etc/svn-auth-file -m sally New password: ******* Re-type new password: ******* Adding password for user sally >
- Create a file called /etc/svnserve.conf
Fill it with:[/] *= svnUser=rw
The user svnUser is being granted read and write access to all projects, while all other users (*) are being denied access.
- Assign permissions:
> chown root.apache /etc/svnserve.conf > chmod 640 /etc/svnserve.conf
- Create /var/svn.
> mkdir -p /var/svn > chmod 755 /var/svn
- If you are running SELinux, run:
> chcon -R -h -t httpd_sys_content_t /var/svn
- You are now ready to being adding Subversion repositories!
Categories: Apache Tomcat, Change Management, Linux Tags: Apache, Linux, Subversion
