差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:alpine_subversion [2022/01/10 16:39] – [安裝與設定 Subversion] jonathan | tech:alpine_subversion [2022/01/10 19:38] (目前版本) – jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 在 Alpine Linux 3 底下安裝 Subversion(SVN) Server ====== | + | ====== |
* 採用 PVE 內提供的 alpine-3.15 (3.4MB) 建立 CT | * 採用 PVE 內提供的 alpine-3.15 (3.4MB) 建立 CT | ||
* 預計安裝與配置: | * 預計安裝與配置: | ||
* CPU:1vcore / RAM:512MB / Root Disk:28GB | * CPU:1vcore / RAM:512MB / Root Disk:28GB | ||
* 啟動主機的 IP 網段 192.168.11.0/ | * 啟動主機的 IP 網段 192.168.11.0/ | ||
+ | * 預計將 SVN repo 檔案放置在 / | ||
+ | * 網站 root 在 / | ||
- | ===== 安裝與設定 | + | ===== 安裝與設定 ===== |
- | * 安裝 | + | * 安裝套件 |
- | apk add mini_httpd | + | apk add python2 nginx subversion |
</ | </ | ||
- | * 啟動 Web Server< | + | * 安裝 submin< |
- | /etc/init.d/mini_httpd start | + | su - root |
+ | wget --no-check-certificate https://github.com/mjholtkamp/ | ||
+ | unzip master.zip | ||
+ | cd submin-master | ||
+ | python2 setup.py install | ||
</ | </ | ||
- | * 設定開機啟動與啟動 | + | |
- | rc-service | + | submin2-admin / |
- | rc-update add squid | + | </ |
+ | : | ||
+ | Which features do you want to enable? [svn, git, apache, nginx]> svn, apache | ||
+ | : | ||
+ | Path to the repository? [svn]> / | ||
+ | : | ||
+ | Hostname? [ct-svn.your.mail.com]> | ||
+ | : | ||
+ | HTTP base? [/ | ||
+ | : | ||
+ | Email from envelope? [Submin < | ||
+ | </ | ||
+ | * 更改 / | ||
+ | chown -R apache: | ||
+ | </ | ||
+ | * 產生 apache 的設定檔 <code sh> | ||
+ | ln -s / | ||
+ | ln -s / | ||
+ | </ | ||
+ | * 設定開機啟動與重新啟動 apache <code sh> | ||
+ | rc-service apache2 start | ||
+ | rc-update add apache2 | ||
+ | </ | ||
+ | * 設定與確認 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 < | ||
+ | submin2-admin /opt/submin config set commit_email_from "SVN < | ||
+ | |||
+ | submin2-admin /opt/submin diagnostics email | ||
+ | </ | ||
+ | * 先設定只有 svn 然後進行整體檢測 <code sh> | ||
+ | submin2-admin /opt/submin config set vcs_plugins svn | ||
+ | submin2-admin /opt/submin diagnostics | ||
+ | </ | ||
+ | * 再來透過 web - http:// | ||
+ | submin2-admin / | ||
+ | |||
+ | |||
+ | < | ||
+ | * 如果第一次開啟網頁出現錯誤訊息 **attempt to write a readonly database** 表示 SELinux 開啟, 必須關閉 SELinux | ||
+ | * <code h vi / | ||
+ | SELINUX=disabled | ||
+ | SELINUXTYPE=targeted | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== 原本 svn 設定網址 http:// | ||
+ | - 更改路徑 svn -> repos <code sh> | ||
+ | submin2-admin /opt/submin config set base_url_svn repos | ||
+ | submin2-admin / | ||
+ | systemctl restart httpd | ||
+ | </ | ||
+ | - 設定 https <code sh> | ||
+ | yum install mod_ssl | ||
+ | systemctl restart httpd | ||
+ | </ | ||
+ | |||
+ | ===== 無法使用 e-mail 寄送密碼通知信件 ===== | ||
+ | * 透過更改 sqlite 內的 admin 密碼方式來解決 | ||
+ | * Exp. 將 admin 密碼改成 123456 <code sh> | ||
+ | cd / | ||
+ | sqlite3 submin.db | ||
+ | |||
+ | update users set password=' | ||
+ | |||
+ | .quit | ||
+ | </ | ||
+ | |||
+ | | ||
+ | rc-service | ||
+ | rc-update add mini_httpd | ||
</ | </ | ||
* 之後如果修改設定可直接執行以下命令檢查與讓 reconfigure 生效< | * 之後如果修改設定可直接執行以下命令檢查與讓 reconfigure 生效< | ||
行 23: | 行 103: | ||
===== 參考網址 ===== | ===== 參考網址 ===== | ||
* https:// | * https:// | ||
- | * https:// | + | |
- | + | | |
- | {{tag> | + | * https:// |
+ | {{tag> |