Home Linux Red Hat Enterprise Server and CentOS
Subversion - Installing and configuring Print E-mail

 

1. Install subversion
yum install subversion mod_dav_svn


2. Create the directory for the subversion repository
mkdir /var/svn-repo


3. Create the subversion repository
cd /var/svn-repo
svnadmin create .
chown -R apache.apache .


4. Create DNS entry in your domain zone file (e.g. svn.atbnet.local)
svn IN A 10.50.1.50


5. Create virtual host in apache for subversion (best using port 443 and SSL)
<virtualhost *:443>
    DocumentRoot /var/svn-repo
    ServerName svn.atbnet.local
    ErrorLog /var/log/httpd/svn-error_log
    CustomLog /var/log/httpd/svn-access_log combined
    <location />
        DAV svn
        SVNPath /var/svn-repo
        AuthType Basic
        AuthName "Subversion Repository"
        AuthUserFile /etc/svn-auth
        Require valid-user
    </location>
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
</virtualhost>


6. Create svn userfile
htpasswd -c /etc/svn-auth-file andy
/usr/sbin/apachectl -t
/etc/init.d/httpd restart

 

7. Set SVN_EDITOR environment variable for commit messages
export SVN_EDITOR=vim
echo "SVN_EDITOR=vim" >> /etc/profile


8. Create basic subversion structure
svn mkdir https://svn.atbnet.local/trunk
svn mkdir https://svn.atbnet.local/branches


9. Start using subversion

Examples:

svn import project1/ https://svn.atbnet.local/trunk/project1

svn copy https://svn.atbnet.local/trunk/project1 https://svn.atbnet.local/branches/project1_andy

svn co https://svn.atbnet.local/branches/project1_andy

svn add index.php

svn commit index.php

 

 

vcplogo 

    

 

DISCLAIMER: All advice, tips, guides and other information on this website is provided as-is with no warranty or guarantee. While most information is correct to the best of my knowledge, I am not reponsible for any issues that may arise in using the information, and you do so at your own risk. As always before doing anything; check, double check, test and always make a backup.

 

Help VMadmin

All resources on this site are provided absolutley free. However it takes time and money to keep the site running. If any information has been helpful to you or your company, and you wish to make a donation to help keep VMadmin.co.uk running you can do so via paypal, and it would be much appreciated.

Click to donate to VMadmin.co.uk via paypal.