Installing and Configuring Subversion on CentOS
This document explains how to install, configure, and use subversion with apache on centos 5.8
[root@svn ~]# cat /etc/redhat-release
CentOS release 5.8 (Final)
CentOS release 5.8 (Final)
[root@svn ~]# uname -r
2.6.18-308.el5
2.6.18-308.el5
Step1)Installation:
Install subversion using yum.
[root@svn ~]# yum install mod_dav_svn subversion
[root@svn ~]# yum install httpd
Now configure apache.
update /etc/httpd/conf/httpd.conf with ServerName.
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn’t have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName 192.168.2.99:80
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work. See also the UseCanonicalName directive.
#
# If your host doesn’t have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName 192.168.2.99:80
[root@svn ~]# service httpd start
Starting httpd: [ OK ]
[root@svn ~]# chkconfig httpd on
Starting httpd: [ OK ]
[root@svn ~]# chkconfig httpd on
The next step is to setup some settings within Apache so Subversion and Apache work together.
[root@svn conf.d]# cd /etc/httpd/conf.d/
update subversion.conf file like below based on your environment.
<Location /repos>
DAV svn
SVNPath /svn/repos
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName “Subversion repos”
AuthUserFile /etc/svn-auth-conf
Require valid-user
# </LimitExcept>
</Location>
DAV svn
SVNPath /svn/repos
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName “Subversion repos”
AuthUserFile /etc/svn-auth-conf
Require valid-user
# </LimitExcept>
</Location>
****************
Now we need to configure password for the file specified in subversion.conf file.
htpasswd -cm /etc/svn-auth-conf username
[root@svn ~]# htpasswd -cm /etc/svn-auth-conf ukatru
New password:
Re-type new password:
Adding password for user ukatru
New password:
Re-type new password:
Adding password for user ukatru
Configure repository:
[root@svn conf.d]# cd /svn
[root@svn svn]# svnadmin create repos
[root@svn svn]# chown -R apache:apache /svn
[root@svn svn]# service httpd restart