一、安装Apache和SVN
在安装之前可以检查一下是否在操作系统安装时已经安装了这些软件,如果没有可以使用下面的命令安装:
> yum install httpd
运行该命令时,会列出要安装的文件和依赖的包,输入y,回车即可。
> yum install mod_dav_svn subversion
二、创建版本库
如果没有svn目录,新建一个
> mkdir svn
使用svnadmin创建一个代码库:
> svnadmin create repos
三、修改配置文件
cat /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 />
DAV svn
SVNParentPath /opt/svndata
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
SVNListParentPath on
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /opt/svndata/conf/passwd
# AuthzSVNAccessFile /opt/svndata/conf/authz
Require valid-user
# </LimitExcept>
</Location>
启动http 则可以进行浏览了。
浙公网安备 33010602011771号