Submin 提供了基於 Web瀏覽器的 Subversion 版本控制系統的管理接口,功能包括用戶、用戶組的管理、路徑權限的設置以及創建新的資料庫等等。兼容各種瀏覽器
搭建配置的是 Submin+Apache+Svn
一、環境配置
1.1.安裝所需要要的包
yum -y install httpd subversion mod_dav_svn subversion-python apr-util-sqlite apr-util vim wget git
mod_dav_svn 是apache支持svn所需要用的model
aprutilsqlite 是apache支持sqlite數據庫所需要用的model
1.2.安裝submin,再進行驗證安裝
git clone https://github.com/mjholtkamp/submin.git
cd submin
python setup.py install
驗證安裝,驗證完成後退出即可
submin2-admin Submin
1.3.創建 svn 根目錄並分配權限給 apache: 根目錄設置爲 /home/svn
這個目錄一定要讓apache有寫入權限,否則就會有問題。因爲http是apache用戶啓動的,所以需要設置
mkdir /home/svn && chown apache:apache /home/svn -R
1.4.交互式配置:
submin2-admin /usr/local/submin/ initenv [email protected]
# 管理員的郵箱地址(任意),/opt/submin/ 爲 submin 配置目錄
1)Which features do you want to enable? [svn, git, apache, nginx]> svn, apache #啓用的特性
2)Path to the repository? [svn]> /home/svn #svn 倉庫根目錄
3)Hostname? [centos7.zhengsw]> 4.56.15.11 #主機名,輸入本機 ip
4)HTTP base? [/]> #http 根路徑,直接回車
5)Email from envelope? [Submin <[email protected]>]>[email protected] #發送郵件時使用的郵箱地址,不需要,回車
1.5.關閉Git支持
submin2-admin /usr/local/submin/ config set vcs_plugins svn
1.6.設置 submin web端賬賬戶:admin:admin
sqlite3 /usr/local/submin/conf/submin.db
>update users set password="$apr1$IipSX7q0$9RMBxwVmSnLu18We252Ko." where name="admin";
7.配置 apache:
submin可以直接生成apache的配置文件,我們可以直接拿來使用,避免了自己配置出現問題,建立軟鏈接配置apache
submin2-admin /usr/local/submin/ apacheconf create all #生成用於 apache 的配置文件
ln -s /usr/local/submin/conf/apache-2.4-webui-cgi.conf /etc/httpd/conf.d/
ln -s /usr/local/submin/conf/apache-2.4-svn.conf /etc/httpd/conf.d/
1.8.啓動 apache:
systemctl restart httpd
systemctl enable httpd
1.9.瀏覽器中訪問:
地址:本機ip/submin 默認用戶與密碼admin/admin
二、郵箱支持(不需要郵件發送可不配置,沒有配置)
Submin可以支持通過smtp來發送郵件,也可以用本地的postfix來發送。管理員郵箱在配置submin的時候我們已經設置過了。
Submin是通過/usr/lib/python2.7/site-packages/submin/email/fallback.py來發送郵件
首先是通過SMTP來發送,如果發送失敗,則通過本地的sendmail
2.1 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 [email protected]
submin2-admin /opt/submin config set smtp_password *****
submin2-admin /opt/submin config set smtp_from "svn <[email protected]>"
submin2-admin /opt/submin config set commit_email_from "svn <[email protected]>"
2.2 配置sendmail(可選)
yum install sendmail sendmail-cf -y
ps aux |grep sendmail
cd /etc/mail
mv sendmail.cf sendmail.cf.bak
m4 sendmail.mc > sendmail.cf
echo "xxxxxxx" |mail -s Test [email protected]
三、Web界面操作
3.1.創建 svn 用戶,並設置密碼
注意:password密碼要輸入兩次,第一次是設置,第二次是保存
3.2.創建用戶組
3.3.創建版本庫
3.4.授權版本庫給用戶或用戶組
3.5.獲取版本庫,拉取
更改新的svn鏈接地址。選擇TortoiseSVN->relocation,再輸入新的URL