Nginx <<
Previous Next >> Ubuntu 簽章
Ubuntu設定
fcitx 中文輸入法安裝:
sudo apt install fcitx fcitx-chewing
表示將採用 fcitx 中文輸入法中的酷音輸入套件.
酷音輸入法的使用牽涉3個步驟, 第1步驟就是上方的套件安裝, 而第2步驟就是進入系統設定中的 language support, 將原先內建的 ibus 改為 fcitx, 而第3步驟則是在輸入 configure 時, 加入 chewing 中文輸入法, 並且將原先的切換鍵 space 改為 ctrl+space.
網路設定:
Ubuntu 21.10 的網路設定取決於 /etc/netplan/net.yaml 檔案設定, 可先將原先的 .yaml 改名為 net.yaml:
sudo mv /etc/netplan/*.yaml /etc/netplan/net.yaml
Network configuration file:
/etc/netplan/net.yaml
# Let NetworkManager manage all devices on this system
network:
ethernets:
enp0s3:
dhcp4: false
addresses:
#- ipv4_address/24
- ipv6_address/64
#gateway4: ipv4_gateway.254
gateway6: ipv6_gateway::254
nameservers:
addresses:
- 2001:b000:168::1
version: 2
#renderer: NetworkManager
每次修改為 /etc/netlan/net.yaml 後必須重新載入設定內容:
sudo netplan apply
在 Ubuntu 操作系統安裝 Fossil SCM server 只需先確認 fossil 的執行位置並且安裝設定 stunnel 即可.
安裝 stunnel:
sudo apt update
sudo apt install stunnel4 -y
安裝 fossil:
sudo apt install fossil
環境變數與開機啟動設定:
/etc/environment 設定:
HTTPS=on
/etc/default/stunnel4 檔案設定:
ENABLED=1
建立 localhost.key 與 localhost.crt:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt
利用 Stunnel 的 exec 與 execargs 執行 fossil command:
請注意, 在 Windows 設定 Fossil SCM server 使用 fossil server 指令, 而在 Ubuntu 則使用 fossil http.
fossil server (Windows 使用) 與 fossil http (Ubuntu 直接以 stunnel execargs 執行) 的差異:
fossil server:
啟動後將以 http 協定在設定的 port 上回應資料.
fossil http:
啟動後將在 stdin 接受單一 http 連線請求, 回應網頁將以 stdout 方式傳送.
設定檔案 /etc/stunnel/stunnel.conf:
[https]
accept = :5443
accept = :::5443
cert = /etc/stunnel/localhost.crt
key = /etc/stunnel/localhost.key
exec = /usr/bin/fossil
execargs = /usr/bin/fossil http /home/wcm2021/repository/ --https --nojail --notfound cmstemplate
表示利用 stunnel 執行 fossil 指令, 並且透過 http 協定啟動 位於 /home/wcm2021/repository 目錄下的倉儲壓縮檔案, 且附加採用 https 與 nojail 模式啟動.
其中 --nojail 目的在 drop the root privilege but do not enter the chroot jail, 其後的 --notfound 表示若沒有特別在 URL 中列出所要擷取的 .fossil 檔案 (指位於 /home/wcm2021/repository/ 目錄下), 則採用 cmstemplate.fossil
重新啟用 stunnel:
sudo /etc/init.d/stunnel4 restart
Nginx <<
Previous Next >> Ubuntu 簽章