RSS
 

Posts Tagged ‘apache’

CentOS 5.3 配置SVN

31 Jul

1.安装subversion

$ yum --disablerepo=\* --enablerepo=c5-media install mod_dav_svn subversion

2.创建svn库

$ cd /var/www/svn
$ svnadmin create repos
$ sudo chown apache.apache repos

3.配置subversion.conf

$ vi /etc/httpd/conf.d/subversion.conf

修改内容如下

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

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, “/var/www/svn”.  Each repository
# must be readable and writable by the ‘apache’ user.  Note that if
# SELinux is enabled, the repositories must be labelled with a context
# which httpd can write to; this will happen by default for
# directories created in /var/www.  Use “restorecon -R /var/www/svn”
# to label the repositories if upgrading from a previous release.
#

#
# To create a new repository “http://localhost/repos/stuff” using
# this configuration, run as root:
#
#   # cd /var/www/svn
#   # svnadmin create stuff
#   # chown -R apache.apache stuff
#

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
#  SVNPath /var/www/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 “Authorization Realm”
AuthUserFile /etc/svn-auth-conf
Require valid-user
</LimitExcept>
</Location>

4.创建svn用户和密码

$ htpasswd -cm /etc/svn-auth-conf yourusername

5.重启apache服务

$ sudo /sbin/service httpd restart

6.浏览器访问地址

http://localhost/svn/repos