Installing SVN with Apache in CentOS & REDHAT

A step by step guide on installing subversion with http support on centos and redhat machine

  1. First of all, install apache/httpd
    • yum install httpd
  2. Make sure you apache is running. You can also type ‘http://localhost’ at your browser and apache test page should appear if your apache is running
    • /etc/init.d/httpd status
  3. Make it start by default on startup
    • chkconfig httpd on
  4. Edit the apache configuration to suit your need. If not sure, leave the default setting as it is
    • vi /etc/httpd/conf/httpd.conf
  5. Install subversion and mod_dav_svn for apache
    • yum install mod_dav_svn subversion
  6. Go to subversion.conf in /etc/httpd/conf.d/. Edit as below
    • cd /etc/httpd/conf.d/
    • vi subversion.conf

1. This is the most basic configuration where anyone will have unrestricted access to the repos. Location is the name that will be used in the browser address bar. In this example it will be ‘http://localhost/svn/repos

2. This is a configuration with username and password for the client

<Location /svn/repos>

DAV svn

SVNListParentPath on

SVNParentPath /usr/local/svn/

AuthType Basic

AuthName “Subversion repositories”

AuthUserFile “/etc/httpd/conf.d/svnuserconf”

Require valid-user


    • htpasswd -cm /etc/httpd/conf.d/svnuserconf admin — This command is not needed for the first configuration. To create the first user with password
    • htpasswd -m /etc/httpd/conf.d/svnuserconf vijay — use this command to add another user
  1. Configure your repository
    • mkdir /usr/local/svn — create folder svn
    • cd /usr/local/svn — change diectory to the newly created svn directory
    • svnadmin create repos — create svn repository named repos
    • chown apache.apache -R repos — change ownership of ‘repos’ to apache
    • /etc/init.d/httpd restart — restart apache
    • If you are running different apache change port no from conf file.
  2. Open you browser and type ‘http://localhost/svn/repos‘. You can see that a page with ‘Revision 0:/’ will appear. Congratulation, you just completed the setup for svn server
  1. Now download svn client ( )

for windows or linux & start using SVN

For more details on svn client refer svn client help.

For more details on svn refer &

Modified By : VIJAY

This entry was posted in Linux. Bookmark the permalink.

2 Responses to Installing SVN with Apache in CentOS & REDHAT

  1. Javier Otin says:

    Great tutorial, thanks for sharing!

  2. Vish says:

    Great tutorial, but it would be nice if you could also add steps to create the repositories.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s