CentOS 8 伺服器作業系統安裝和設定
系統安裝
系統模式
使用 CentOS 8 安裝檔開機會有下述三種模式:
- Install CentOS Linux 8:正常安裝系統流程。
- Test this media & install CentOS Linux 8:測試媒體後在進入安裝系統流程。
- Troubleshooting:進入【除錯模式】,能夠救授 CentOS 系統和執行記憶體測試 (Run a memory test) ...。

選擇系統語言

磁碟分割與檔案系統
/home、swap 和 / 這三個【掛載點】將來容量有可能會變動,因此【裝置類型】設定為可以彈性增加和減少檔案系統容量的 LVM。
掛載點 | 裝置類型 | 檔案系統 | 建議容量 |
---|---|---|---|
biosboot | 標準分割區 | BIOS Boot | 2MB |
/boot | 標準分割區 | ext4 | 1GB |
/home | LVM | xfs | 5GB 以上 |
swap | LVM | swap | 參考 Red Hat swap 建議 |
/ | LVM | xfs | 剩餘容量 |
點選【安裝目的地】,就是要將系統安裝到哪個磁碟。

- 勾選系統要安裝的磁碟。
- 點選【自訂】來自行手動分割。
- 點擊【完成】。

點擊【+】加入新的掛載點。

依照下圖來新增其它所有掛載點。








【欲使用容量】未輸入時,則會將剩餘的【可用容量】全部分配給它。


- 所有掛載點分割完後點擊【完成】。
- 點擊【接受變更】。

軟件選擇
系統預設選擇安裝【含有 GUI 的伺服器】,也就是像 Windows 作業系統一樣有圖形使用者介面,但作為伺服器用途建議選擇【最小型安裝】的 CLI (命今列介面),它不會安裝額外的軟體,所有需要使用的軟體均需自行安裝,而且少了 GUI 效率更佳 。

- 點選【最小型安裝】。
- 點擊【完成】。

網路和主機名稱

點擊【配置】進行網路設定。

作為伺服器用途通常都會指定固定 IP。
- 點擊【IPv4 設定】。
- 點擊【新增】並輸入固定 IP【地址】的相關配置。
- 設定【DNS servers】,可使用逗號 , 分隔輸入多組。
- HiNet:168.95.1.1。
- Google:8.8.8.8。
- 點擊【儲存】。

- 點擊【一般】。
- 勾選【Connect automatically with priority】網路可用時自動連線。
- 點擊【儲存】。

點擊【完成】。

時間和日期

- 選取【區域】和【城市】。
- 啟用【網路時間】NTP (網路時間協定) 網路自動校時。
- 點擊【完成】。

開始安裝
上述所有設定均確認無誤後,點擊【開始安裝】。

點擊【根密碼】來設定 root 的密碼。


點擊【創建用戶】來建立使用者。



安裝完成,點擊【重新開機】。



其它
安裝 Cockpit
Cockpit 是基於 Web 介面的應用程式,可用來管理伺服器並監視和調整系統資源。
如果 CentOS 8 是使用【最小型安裝】Cockpit 須手動安裝:
dnf install -y cockpit
設定 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。



本著作係採用創用 CC 姓名標示-相同方式分享 3.0 台灣 授權條款授權.