CentOS7 安裝 SVN + submin
- 安裝相關套件
yum install epel-release httpd mod_ssl subversion mod_dav_svn subversion-python wget apr-util-sqlite apr-util
- 安裝 submin
su - root wget --no-check-certificate https://github.com/mjholtkamp/submin/archive/master.zip unzip master.zip cd submin-master python2 setup.py install
安裝設定 submin
- 設定 submin Exp. 管理者信箱 [email protected]
submin2-admin /opt/submin/ initenv [email protected]
: Which features do you want to enable? [svn, git, apache, nginx]> svn, apache : Path to the repository? [svn]> /var/www/svn :
- 更改 /var/www/svn 擁有者為 apache
chown -R apache:apache /var/www/svn
- 產生 apache 的設定檔
submin2-admin /opt/submin/ apacheconf create all 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 enable httpd systemctl restart httpd
- 設定 firewall
firewall-cmd --add-service=http firewall-cmd --add-service=https firewall-cmd --permanent --add-service=http firewall-cmd --permanent --add-service=https
- 設定與確認 E-Mail 是否可以正常運作
submin2-admin /opt/submin config set smtp_hostname 192.168.1.1 submin2-admin /opt/submin config set smtp_port 25 submin2-admin /opt/submin config set smtp_username **your-userid** submin2-admin /opt/submin config set smtp_password **your-password** submin2-admin /opt/submin config set smtp_from "SVN <[email protected]>" submin2-admin /opt/submin config set commit_email_from "SVN <[email protected]>" submin2-admin /opt/submin diagnostics email
- 先設定只有 svn 然後進行整體檢測
submin2-admin /opt/submin config set vcs_plugins svn submin2-admin /opt/submin diagnostics
- 再來透過 web - http://your.url.com/submin/ 就可以使用 Forgot your password? 輸入一開始安裝時
submin2-admin /opt/submin/ initenv [email protected]
的這個 E-Mail - [email protected] 將重設 admin 的密碼連結寄至這信箱, 接下來就可以在 web 上面建立 svn 的使用者與 repos
- 如果第一次開啟網頁出現錯誤訊息 attempt to write a readonly database 表示 SELinux 開啟, 必須關閉 SELinux
- vi /etc/selinux/config
SELINUX=disabled SELINUXTYPE=targeted
原本 svn 設定網址 http://svn.myurl.com/svn 要改成 https://svn.myurl.com/repos
- 更改路徑 svn → repos
submin2-admin /opt/submin config set base_url_svn repos submin2-admin /opt/submin/ apacheconf create all systemctl restart httpd
- 設定 https
yum install mod_ssl systemctl restart httpd
無法使用 e-mail 寄送密碼通知信件
- 透過更改 sqlite 內的 admin 密碼方式來解決
- Exp. 將 admin 密碼改成 123456
cd /opt/submin/conf sqlite3 submin.db update users set password='$apr1$EfayX1XO$QorId6q9YgRHBERgVZWGv/' where name='admin'; .quit