AlmaLinux 9 伺服器作業系統安裝和設定
系統安裝
系統模式
使用 AlmaLinux 9 安裝檔開機會有下述三種模式:
- Install AlmaLinux 9.2:正常安裝系統流程。
- Test this media & install AlmaLinux 9.2:測試媒體後在進入安裝系統流程。
- Troubleshooting:進入【除錯模式】,能夠救授 AlmaLinux 系統和執行記憶體測試 (Run a memory test) ...。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/4ae5b5494e4bf95cb48adb7bd94db08f.jpg?resize=640%2C480&ssl=1)
選擇系統語言
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/419e8c6bb842f0242a74524444d27553.jpg?resize=800%2C600&ssl=1)
選擇軟體
系統預設選擇安裝【含有 GUI 的伺服器】,也就是像 Windows 作業系統一樣有圖形使用者介面,但作為伺服器用途建議選擇【Server】的 CLI (命今列介面),而且少了 GUI 效率更佳 。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/120e892f4794a829ab1a825e02664b0a.jpg?resize=800%2C600&ssl=1)
- 點選【Server】。
- 點擊【完成】。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/57bd3e652f5fe3fadb91388e5aba1bdd.jpg?resize=800%2C600&ssl=1)
磁碟分割與檔案系統
/home、swap 和 / 這三個【掛載點】將來容量有可能會變動,因此【裝置類型】設定為可以彈性增加和減少檔案系統容量的 LVM。
掛載點 | 裝置類型 | 檔案系統 | 建議容量 |
---|---|---|---|
biosboot | 標準分割區 | BIOS Boot | 2MB |
/boot | 標準分割區 | ext4 | 1GB |
/home | LVM | xfs | 5GB 以上 |
swap | LVM | swap | 參考 Red Hat swap 建議 |
/ | LVM | xfs | 剩餘容量 |
點選【安裝目標位置】,就是要將系統安裝到哪個磁碟。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/bc71e1e09e9a1171715c320f6c486af9.jpg?resize=800%2C600&ssl=1)
- 勾選系統要安裝的磁碟。
- 點選【自動】或【自訂】方式來自行手動分割磁碟空間。
- 點擊【完成】。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/0b663c8ca93bf33fb863c329122a7359.jpg?resize=800%2C600&ssl=1)
Root 密碼與新增使用者
設定 Root 密碼。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/3e7a6e69347ab7e25eac2c4a80a038e3.jpg?resize=800%2C600&ssl=1)
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/afd8d23d2872abb02d20d9a48131ab1d.jpg?resize=800%2C600&ssl=1)
建立使用者。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/0835ae4e94b2fb0d06fdc5a68629c01f.jpg?resize=800%2C600&ssl=1)
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/44e1577e63d783ec4c23dae642e97879.jpg?resize=800%2C600&ssl=1)
安裝
點擊【開始安裝】。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/7e9ee2db789596102ee038895bf7db5f.jpg?resize=800%2C600&ssl=1)
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/c1cc857cee5a572d69d23a4611351adb.jpg?resize=800%2C600&ssl=1)
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/ea8c78f80335712f47ea0173bb7fc9af.jpg?resize=800%2C600&ssl=1)
其它
安裝 Cockpit
Cockpit 是基於 Web 介面的應用程式,可用來管理伺服器並監視和調整系統資源。
設定 Cockpit 開機自動啟用 (enable) 且立即啟用 (--now):
systemctl enable --now cockpit.socket
firewall 預設已允許 cockpit (port 9090):
firewall-cmd --list-all
public (active) target: default icmp-block-inversion: no interfaces: enp0s3 sources: services: cockpit dhcpv6-client ssh ... 以下省略 ...
開啟瀏覽器輸入 IP:9090 即可連結到 Cockpit。
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/24961d8be27c73409e69f423d13b6958.png?resize=1024%2C609&ssl=1)
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/44011fd83ef0975e1be2047cd86012bc.png?resize=1024%2C999&ssl=1)
安裝 Cockpit 虛擬機
dnf install cockpit-machines
dnf install libvirt
systemctl enable --now libvirtd
![](https://i0.wp.com/footmark.com.tw/wp-content/uploads/2023/11/b8eb6e9b836a9391980fb020aa0a1b35.png?resize=1024%2C999&ssl=1)
![創用 CC 授權條款](https://i.creativecommons.org/l/by-sa/3.0/tw/88x31.png)
本著作係採用創用 CC 姓名標示-相同方式分享 3.0 台灣 授權條款授權.