笔记一下。
升级apt源
apt-get update
安装SVN
apt-get install subversion subversion-tools apache2 libapache2-svn
创建文件夹
mkdir -p /home/subversion/
subversion初始化目录
svnadmin create /home/subversion/game/
配置Apache方便subversion通过HTTP访问
- 安装非SSL加密的HTTP访问
- 修改/etc/apache2/mods-available/dav_svn.conf 文件
- 修改权限
chown -R www-data:www-data /home/subversion/game/
- 设定apache2
<Location /code>
DAV svn
#SVNParentPath /home/svn
SVNPath /data/svn/code
ModMimeUsePathInfo on
AuthzSVNAccessFile /data/svn/code/conf/authz
AuthzSVNAnonymous off
AuthzSVNNoAuthWhenAnonymousAllowed off
AuthType Basic
AuthName “Subversion”
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
- 设定svn用户组和目录权限,位于以上设置的AuthzSVNAccessFile 路径 /data/svn/code/conf/authz文件内:
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
admin = qingran,w
dev = r,a,b,c
[/]
@admin = rw
@dev = rw
- 设置密码
htpasswd -c /etc/apache2/dav_svn.passwd <username>
htpasswd /etc/apache2/dav_svn.passwd <username>