概述python
没有找到可让团队方便使用的云盘,暂时搭建一个svn凑合用一下nginx
svn有三种安装方式git
安装方式 | 服务程序 | 服务协议 | 用户和密码 | 受权 | 系统配置 |
---|---|---|---|---|---|
svn独立安装 | svnserve | svn | passwd文件(明文密码) | authz文件 | svnserve.conf文件 |
apache+svn安装 | httpd | http WebDAV | htpasswd命令(密文密码) | authz文件 | httpd.conf文件 |
apache+svn+submin | httpd+ pythonCGI | http WebDAV | WebUI(sqlite3) | WebUI(authz文件) | submin2-admin命令 |
1、安装apacheweb
检查apache是否安装sql
rpm -qa|grep httpd
使用yum安装apache数据库
yum -y install httpd
记住安装的版本号apache
httpd.x86_64 0:2.4.6-31.el7.centos
启动apache测试apache是否可用
注意:在centos7中使用systemctl替换了servicecentos
systemctl start httpd.service systemctl status httpd.service
浏览器输入IP查看是否能显示如下页面浏览器
5. apache安装路径
/etc/httpd服务器
2、安装SVN
检查svn是否安装
rpm -qa|grep subversion
阿里云已经安装了svn,若是没有安装使用 yum install subversion 命令安装
使用命令查看版本
svnserve --version
记住版本号svnserve,版本 1.7.14 (r1542130)
安装apache对svn的支持模块
yum install mod_dav_svn
#安装完成后apache的modules目录下会多两个文件
mod_authz_svn.so mod_dav_svn.so
安装python对svn的支持
yum install subversion-python
3、安装submin
能够参照 https://ssl.supermind.nl/collab/projects/submin/browser/INSTALL
submin依赖
- If you want subversion, you also need apache. If only git is needed, you can also install nginx.
- Python 2.x Python 2.7 preferred, but 2.6 should work,使用python —version查看python 版本
- Subversion
下载最新版本 http://supermind.nl/submin/current/submin-2.2.1-1.tar.gz
上传到服务器 sftp
解压文件
tar -xzvf submin-2.2.1-1.tar.gz
安装
cd submin-2.2.1-1/ python setup.py install
验证安装
执行 submin2-admin 成功显示当前版本
配置submin
submin2-admin /opt/submin/ initenv your@email.address
邮箱很重要, submin会将管理员设置初始口令的连接发到这邮箱中
/opt/submin这个目录不要提早建,安装命令的向导一步步设置就能够了,说明很清楚.
这一步须要注意
Please provide a location for the Subversion repositories. For new Subversion
repositories, the default setting is ok. If the path is not absolute, it will
be relative to the submin environment. If you want to use an existing
repository, please provide the full pathname to the Subversion parent
directory (ie. /var/lib/svn).
Path to the repository? [svn]>
这个目录我设置的时 /opt/svn,注意这个目录apache必定要有写权限,不然会报如下错误
E165002 /opt/svn is an existing repository
由于submin是用apache用户启动的,最简单的方式是将该目录全部者设置为apache,执行如下命令
chown apache:apache /opt/svn/
配置apache
生成配置文件
submin2-admin /opt/submin/ apacheconf create all
创建软连接配置apache,注意Apache版本
ln -s /opt/submin/conf/apache-2.4-webui-cgi.conf /etc/httpd/conf.d/ ln -s /opt/submin/conf/apache-2.4-svn.conf /etc/httpd/conf.d/
重启apache
systemctl restart httpd.service
报错 Can’t load driver file apr_dbd_sqlite3.so
submin2默认须要sqlite3作数据库
yum -y install apr-util-sqlite apr-util
再次重启OK
4、邮箱设置
/usr/lib/python2.7/site-packages/submin/email/fallback.py
def sendmail(sender, receiver, message): msg_e = message.encode('utf-8') try: smtp.send(sender, receiver, msg_e) except SendEmailError: # this can still raise SendEmailError local.send(sender, receiver, msg_e)
优先使用stmp发邮件。 异常时使用本地的sendmail,配置smtp
submin2-admin /opt/submin config set smtp_hostname smtp.exmail.qq.com submin2-admin /opt/submin config set smtp_port 25 submin2-admin /opt/submin config set smtp_username svn@xxxxx.com submin2-admin /opt/submin config set smtp_password xxxxxx submin2-admin /opt/submin config set smtp_from "svn <svn@xxxx.com>" submin2-admin /opt/submin config set commit_email_from "svn <svn@xxxx.com>"
5、诊断submin
执行如下命令
submin2-admin /opt/submin/ diagnostics
若是有问题参照说明修改对应错误
我设置出现了如下问题:
To disable, run the following command: submin2-admin /opt/submin config set vcs_plugins svn
若是不由用git,之后的操做都会报git没有设置的错误
6、管理员重置密码
输入admin,点击重置,如下命令配置的邮箱将会受到密码重置邮件
submin2-admin /opt/submin/ initenv your@email.address
7、新建仓库sharing
输入名称,选择svn建立仓库
8、受权
点击左侧菜单最下面中间两我的的按钮,新建组
点击左侧菜单最下面的左侧一我的的按钮,新建用户
新建完成用户后,用户会收到密码重置邮件,同时系统进入修改用户信息页面,能够将用户添加到developer组
设置权限,点击左侧须要受权的仓库按钮
针对特定的路径设置组或用户并设置对应的读写权限,这里我给developer设置root的读写权限