SWAT Blog

Install SVN SERVER (subversion) on CENTOS 5

December 9th, 2010 by Bhagwan Dass

Prerequisites

  • Fresh installation of CentOS 5.
  • Make sure you should login as root.
  • Make sure you should have apache2 installed (httpd).

Installation Steps
First we’ll install Apache configuration directives for serving Subversion repositories through Apache HTTP Server.

[root@linux10 ~]#yum install subversion mod_dav_svn

Instruct Apache to load the mod_dav_svn module using the LoadModule directive by editing http.conf file

[root@linux10 ~]#vi /etc/httpd/conf/httpd.conf

If the following two lines are not present, add them:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

Create a directory where all svn repositories will be located:

[root@linux10 ~]#mkdir /srv/svn

Create your first Repository

[root@linux10 ~]#svnadmin create --fs-type fsfs /srv/svn/your_project_name

Set the correct file permissions for apache.

[root@linux10 ~]#chown -R apache.apache /srv/svn/your_project_name

Tell Apache where to find the new repository. Here we create an additional Apache configuration file specifically for the repositories.

[root@linux10 ~]#vi /etc/httpd/conf.d/subversion.conf

Add the following directive in the subversion.conf file

DAV svn
SVNPath /srv/svn/your_project_name
AuthType Basic
AuthName "your_project_name Repository"
AuthzSVNAccessFile /srv/svn/svn-acl-conf
AuthUserFile /srv/svn/your_project_name.htpasswd
Require valid-user

Add a repository user

[root@linux10 ~]#touch /srv/svn/your_project_name.htpasswd
[root@linux10 ~]#htpasswd -m /srv/svn/your_project_name.htpasswd  username

Create the Access Control List for the SVN Repository

[root@linux10 ~]#vi /srv/svn/svn-acl-conf

Add the following directives in the file. Where username represents the username of the repository user you created earlier.

[your_project_name:/]
username = rw

Final step, restart Apache server.

[root@linux10 ~]#service httpd restart

After browsing your project, if you gets the below message that means you have done it successfully.

http://localhost/svn/your_project_name

Revision 0: /
Powered by Subversion version 1.4.2 (r22196).

Tags: , , ,

6 Responses to “Install SVN SERVER (subversion) on CENTOS 5”

  1. bet365 says:

    hello I was fortunate to seek your blog in baidu
    your Topics is splendid
    I obtain a lot in your theme really thank your very much
    btw the theme of you blog is really brilliant
    where can find it

  2. EdwardsTeem says:

    Man, really want to know how can you be that smart, lol…great read, thanks.

  3. Hello atul ,

    Thanks for making my day .. im search from the long time svn installation. So here it is … keeping inviting …. and writing.

    thanks
    Siddharth

  4. Rob says:

    Great tutorial on installing and configuring svn, don’t forget you need to also allow access to the repository through svnserve.conf

    http://www.duchnik.com/tutorials/vc/installing-and-configuring-svn-on-centos

    There is also a great tutorial on setting up websvn, a great graphical tool for viewing your svn repository:

    http://www.duchnik.com/tutorials/vc/setting-up-and-configuring-websvn

  5. wonderful post, very informative. I ponder why the other experts of this sector don’t notice this. You should continue your writing. I’m confident, you’ve a great readers’ base already!

Leave a Reply for EdwardsTeem

  • © 2004-2015 Special Work & Technology Limited