差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
tech:centos7_svn [2019/11/15 14:44]
jonathan_tsai [CentOS7 安裝 SVN + submin]
tech:centos7_svn [2019/11/15 16:50] (目前版本)
jonathan_tsai [CentOS7 安裝 SVN + submin]
行 1: 行 1:
 +====== CentOS7 安裝 SVN + submin ======
 +  * 安裝相關套件 <code sh>
 +yum install epel-release httpd mod_ssl subversion mod_dav_svn subversion-python wget apr-util-sqlite apr-util
 +</code>
 +  * 安裝 submin <code sh>
 +su - root
 +wget --no-check-certificate https://github.com/mjholtkamp/submin/archive/master.zip
 +unzip master.zip
 +cd submin-master
 +python2 setup.py install
 +</code>
 +
 +===== 安裝設定 submin =====
 +  * 設定 submin Exp. 管理者信箱 [email protected]<code sh>
 +submin2-admin /opt/submin/ initenv [email protected]</code><file>
 +:
 +Which features do you want to enable? [svn, git, apache, nginx]> svn, apache
 +:
 +Path to the repository? [svn]> /var/www/svn
 +:
 +</file>
 +  * 更改 /var/www/svn 擁有者為 apache <code>
 +chown -R apache:apache /var/www/svn
 +</code>
 +  * 產生 apache 的設定檔 <code sh>
 +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/
 +</code>
 +  * 設定開機啟動與重新啟動 apache <code sh>
 +systemctl enable httpd
 +systemctl restart httpd
 +</code>
 +  * 設定 firewall <code sh>
 +firewall-cmd --add-service=http
 +firewall-cmd --add-service=https
 +firewall-cmd --permanent --add-service=http
 +firewall-cmd --permanent --add-service=https
 +</code>
 +  * 設定與確認 E-Mail 是否可以正常運作<code sh>
 +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
 +</code>
 +  * 先設定只有 svn 然後進行整體檢測 <code sh>
 +submin2-admin /opt/submin config set vcs_plugins svn
 +submin2-admin /opt/submin diagnostics
 +</code>
 +  * 再來透過 web - http://your.url.com/submin/ 就可以使用 Forgot your password? 輸入一開始安裝時 <code sh>
 +submin2-admin /opt/submin/ initenv [email protected]</code> 的這個 E-Mail - [email protected] 將重設 admin 的密碼連結寄至這信箱, 接下來就可以在 web 上面建立 svn 的使用者與 repos
 +
 +
 +<note>
 +  * 如果第一次開啟網頁出現錯誤訊息 **attempt to write a readonly database** 表示 SELinux 開啟, 必須關閉 SELinux
 +    * <code h vi /etc/selinux/config >
 +SELINUX=disabled
 +SELINUXTYPE=targeted
 +</code>
 +
 +</note>
 +
 +===== 原本 svn 設定網址 http://svn.myurl.com/svn 要改成 https://svn.myurl.com/repos =====
 +    - 更改路徑 svn -> repos <code sh>
 +submin2-admin /opt/submin config set base_url_svn repos
 +submin2-admin /opt/submin/ apacheconf create all
 +systemctl restart httpd
 +</code>
 +    - 設定 https <code sh>
 +yum install mod_ssl
 +systemctl restart httpd
 +</code>
 +
 +===== 無法使用 e-mail 寄送密碼通知信件 =====
 +  * 透過更改 sqlite 內的 admin 密碼方式來解決
 +  * Exp. 將 admin 密碼改成 123456 <code sh>
 +cd /opt/submin/conf
 +sqlite3 submin.db 
 +
 +update users set password='$apr1$EfayX1XO$QorId6q9YgRHBERgVZWGv/' where name='admin';
 +
 +.quit
 +</code>
 +
 +===== 參考網址 =====
 +  * https://www.cnblogs.com/zhangqigao/p/5729491.html
 +  * https://ssl.supermind.nl/collab/projects/submin/browser/INSTALL
 +  * https://ssl.supermind.nl/collab/projects/submin/browser/CONFIGURATION
 +  * https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html
 +  * https://stackoverflow.com/questions/21054245/attempt-to-write-a-readonly-database-django-w-selinux-error
 +  * https://itw01.com/YCXNEVU.html
 +
 +{{tag>svn subversion}}