172173.com

参考文档《Submin 部署SVN服务器WEB管理端 CentOS7》http://blog.51cto.com/990487026/1974106
官方网站:https://github.com/mjholtkamp/submin
操作系统:CentOS7.6
Subversion:1.8
Apache:2.4
Python:2.7

一、submin介绍

1.介绍

submin - 类似于svnmanager的svn用户与仓库管理的web管理平台,用python2开发的,比svnmanager轻量,部署非常容易,环境只需要python2+apache即可。数据库用sqlit3存储。

2.关于svn从备份

  • 备份可以参考rsync svn主从备份,即备份物理数据目录:/data/svn,/etc/apache/conf.d,/data/wwwroot/svn.test.com/submin
  • /data/wwwroot/svn.test.com/submin/conf/submin.db,这个是sqlit3的数据库备份文件,很重要,要备份。

二、submin部署

1.安装submin

1
2
3
4
5
6
yum install -y subversion-python mod_dav_svn apr-util-sqlite
cd /usr/local/src/
wget https://github.com/mjholtkamp/submin/archive/master.zip
unzip master.zip
cd submin-master/
python setup.py install

2.创建svn仓库根目录

1
2
3
cd /data/svn
mkdir -p {submin_data,submin_pass,submin_log,submin_trash}
chown -R apache.apache ./submin*

3.交互式配置submin

1
2
3
4
5
6
[[email protected] svn]# submin2-admin /data/wwwroot/svn.test.com/submin/ initenv [email protected]     #  管理员的邮箱地址(任意),/data/wwwroot/svn.test.com/submin/ 为 submin 配置目录
Which features do you want to enable? [svn, git, apache, nginx]> svn, apache # 启用的特性
Path to the repository? [svn]> /data/svn/submin_data # svn 仓库根目录
Hostname? [localhost.localdomain]> 192.168.99.207 # 主机名,输入本机 ip
HTTP base? [/]> # http 根路径,直接回车
Email from envelope? [Submin <[email protected]>]> [email protected] # 发送邮件时使用的邮箱地址,不需要,回车

4.submin 配置为使用 svn(默认为 git)

1
submin2-admin /data/wwwroot/svn.test.com/submin/ config set vcs_plugins svn

5.设置 submin web端账账户密码:admin:admin:

1
2
3
[[email protected] svn]# sqlite3 /data/wwwroot/svn.test.com/submin/conf/submin.db
sqlite> update users set password="$apr1$IipSX7q0$9RMBxwVmSnLu18We252Ko." where name="admin";
sqlite> .quit

6.配置apache

生成用于 apache 的配置文件

1
submin2-admin /data/wwwroot/svn.test.com/submin/ apacheconf create all

apache2.4以上拷贝两个配置文件

1
2
3
cd /data/wwwroot/svn.test.com/submin/conf/
cp apache-2.4-webui-cgi.conf /etc/httpd/conf.d/ # mv重命名成subversion.conf
cp apache-2.4-svn.conf /etc/httpd/conf.d/

配置vhosts

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[[email protected]st conf.d]# cat subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<VirtualHost *:80>
DocumentRoot "/data/wwwroot/svn.test.com"
ServerName svn.test.com
ServerAlias svn.test.com
ErrorLog "/data/httplogs/svn.test.com-error.log"
CustomLog "/data/httplogs/svn.test.com-access.log" complex
<IfModule !mod_authn_dbd.c>
AliasMatch "^/svn" /usr/lib/python2.7/site-packages/submin/static/www/nomodauthndbd.html
<Location "/svn">
Require all granted
</Location>
</IfModule>
<IfModule mod_authn_dbd.c>
DBDriver sqlite3
DBDParams "/data/wwwroot/svn.test.com/submin/conf/submin.db"
<IfModule mod_dav_svn.c>
<Location "/subsvn">
DAV svn
SVNParentPath /data/svn/submin_data
AuthType Basic
AuthName "Subversion repository"
AuthBasicProvider dbd
AuthDBDUserPWQuery "SELECT password FROM users WHERE name=%s"
AuthzSVNAccessFile /data/wwwroot/svn.test.com/submin/conf/authz
Satisfy Any
Require valid-user
</Location>
</IfModule>
</IfModule>
</VirtualHost>

relaod

1
2
apache -t
apache graceful

7.访问submin

账号密码:amdin:admin

 评论