Friday, 8 July 2011

Step by Step Subversion Installation Reference for Redhat Linux

SVN Subversion installation steps on server
=============================
I am expecting you have already installed Apache http web server on your linux machine (Here using RHEL-5).

1. # Download following rpm files in the (path) /opt/sware/svn
cd /opt/sware/svn

2. # Download Following From: http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/rhel5/x86_64/
-----------------------------
mod_dav_svn-1.5.5-1.rhel5.x86_64.rpm
neon-0.27.2-1.x86_64.rpm
neon-debuginfo-0.27.2-1.x86_64.rpm
neon-devel-0.27.2-1.x86_64.rpm
subversion-1.5.5-1.rhel5.x86_64.rpm
subversion-devel-1.5.5-1.rhel5.x86_64.rpm
subversion-perl-1.5.5-1.rhel5.x86_64.rpm
subversion-python-1.5.5-1.rhel5.x86_64.rpm
subversion-tools-1.5.5-1.rhel5.x86_64.rpm

3. # Install subversion and dependent
rpm -U neon-0.27.2-1.x86_64.rpm
rpm -U neon-devel-0.27.2-1.x86_64.rpm
rpm -i subversion-1.5.5-1.rhel5.x86_64.rpm
rpm -i mod_dav_svn-1.5.5-1.rhel5.x86_64.rpm

4. # Create an SVN repository
svnadmin create /svnroot

5. # Make it accessible to the web server
chown -R apache.apache /svnroot/

6. # Edit the web servers configuration
vi /etc/httpd/conf/httpd.conf

7. # Uncomment (remove the '#' mark) the following lines:
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_module modules/mod_dav.so

8. # Add the following lines to the configuration:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule dav_svn_module modules/mod_authz_svn.so
<Location /svn>
    DAV svn
    SVNPath /svnroot
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/httpd/conf.d/dav_svn.passwd
    Require valid-user
</Location>

9.
# Add a new user to the authentication file. Only
# authenticated users will be able to access the repository.
# The passwords are held in this file using a one-way hashed
# encryption
htpasswd -c /etc/httpd/conf.d/dav_svn.passwd test.user1
# To add a new user (again other than first time)
htpasswd -c /etc/httpd/conf.d/dav_svn.passwd test.user1

10. # Restart the web server for the settings to take effect
/etc/init.d/httpd restart

11. http://your-domain.com/svn
Example: http://edurain.com/svn

A short setting explanation of what you just entered:
======================================
<Location /svn>: Means that the Subversion repositories are available from the URL like http://edurain.com/svn/
DAV svn: tells Apache which module will be responsible to serve that URL - in this case the Subversion module.
SVNListParentPath on: For Subversion version 1.3 and higher, this directive enables listing all the available repositories under SVNParentPath.
SVNParentPath /svnroot: tells Subversion to look for repositories below /svnroot
SVNIndexXSLT "/svnindex.xsl": Used to make the browsing with a web browser prettier.
AuthType Basic: is to activate basic authentication, i.e. Username/password
AuthName "Subversion repositories": is used as an information whenever an authentication dialog pops up to tell the user what the authentication is for
AuthUserFile passwd: specifies which password file to use for authentication
AuthzSVNAccessFile: Location of the Access file for paths inside a Subversion repository
Require valid-user: specifies that only users who entered a correct username/password are allowed to access the URL

4 comments:

  1. Thanks ...

    it`s very use full article for svn implementation in linux server.

    Regards
    AmitV

    ReplyDelete
  2. Did you face any errors while installing it? My concern is Apache webserver is already installed in my machine but whether it will be compatible with the latest version of subversion?
    Also where the mod_dav_svn will get installed. Based on the installation location do we have to change the configuration in httpd.conf?

    ReplyDelete
  3. m not getting the url in browser

    ReplyDelete
  4. m not getting the access to repository

    its telling me ('.' is not a working copy) what does that implies ??

    ReplyDelete