1.安装
debian:/# aptitude install subversion subversion-tools apache2 libapache2-svn
2.创建一个新的subversion储存库:
debian:/# svnadmin create /lxq
在/lxq目录创建一个新的空储存库,数据储存方式默认采用Berkeley DB。
3.更改该目录的拥有者为网页读取
修改/data/subversion目录访问权限使它可被Apache进程访问,我的Apache是用www-data启动的,所以设置方法如下:
debian:/# chown -R www-data.www-data /data/subversion4.修改apache的svn设定文档:/etc/apache2/mods-available/dav_svn.conf
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
# ...
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/
#设置访问路径
# Uncomment this to enable the repository,
DAV svn #启用
# Set this to the path to your repository
SVNPath /data/subversion #设置储存库路径,仅支持单个储存库,该路径要可被Apache进程访问。
#SVNParentPath /data/subversion #如果subversion下有多个储存库,则用SVNParentPath
# The following allows for basic http authentication. Basic authentication
# should not be considered secure for any particularly rigorous definition of
# secure.
# to create a passwd file #按下面的步骤创建Apache用户验证文件
# # rm -f /etc/apache2/dav_svn.passwd
# # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
# New password:
# Re-type new password:
# Adding password for user dwhedon
# #
# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic #启用Apache基础验证
AuthName "Subversion Repository" #设置验证框标题
AuthUserFile /etc/apache2/dav_svn.passwd #指定验证用户文件名
# Uncomment the following line to enable Authz Authentication
AuthzSVNAccessFile /etc/apache2/dav_svn.authz #启用目录级别授权,dav_svn.authz是授权配置文档
# The following three lines allow anonymous read, but make
# committers authenticate themselves.
# #允许匿名访问,不允许Commit,不能与AuthzSVNAccessFile同时使用
Require valid-user
#
5.设定使用人的权限:修改/etc/apache2/dev_svn.authz