Posts Tagged ‘apache’

Install SVN SERVER (subversion) on CENTOS 5

Thursday, December 9th, 2010


  • 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.

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.


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

  • © 2004-2015 Special Work & Technology Limited