使用 Plesk CLI 實現安裝後配置
-
執行初始的伺服器設定
使用
init_conf
utility with--init
命令提供初始化伺服器所需的資訊。該資訊包括:- Plesk 管理員的個人資訊,
- Plesk 管理員的新密碼而不是安裝過程中生成的預設密碼,
- 完整的主機名稱(備選)。
欲瞭解有關使用 CLI 執行伺服器初始化設定的資訊,請參閱:
- 對於 Linux: init_conf: 伺服器配置
- 對於 Windows: init_conf.exe: 伺服器初始配置和管理員的個人資訊
-
安裝產品許可證金鑰
使用許可證工具在伺服器上安裝產品許可證金鑰以及額外的許可證金鑰。
欲瞭解如何使用 CLI 安裝許可證金鑰,請參閱:
- 對於 Linux: license: 許可證金鑰
- 對於 Windows: license.exe: 許可證金鑰
以下操作不是 Plesk 安裝後配置必需的,但是對進一步配置 Plesk 以適應生產環境有幫助。
定義 Plesk 視圖
使用 poweruser
工具在 Plesk 介面視圖之間切換。
欲瞭解有關切換 Plesk 介面視圖的詳情,請參閱:
- 對於 Linux: poweruser: 高級使用者模式
- 對於 Windows: poweruser.exe: 高級用戶視圖
服務提供者視圖和高級用戶視圖的用途和不同點請參閱: Plesk GUI 。
預設的區域設定
使用 admin --update -locale
設定指定語言為 Plesk GUI 的預設語言。
欲瞭解如何配置管理員介面偏好設定的詳情,請參閱:
- 對於 Linux: admin: 管理員面板偏好設定
- 對於 Windows: admin.exe: 管理員面板偏好設定
示例 1:執行伺服器初始化設定
The following command:
- sets the default IP address to 192.0.2.14 and sets its type to shared;
- sets the network mask to 255.255.255.0 and the network interface name to eth0 for the default IP address;
- adds shared IP addresses 192.0.2.46 and 192.0.2.47 to Plesk;
- sets the Plesk administrator’s name to 「John Doe」 and the administrator’s password to adminpass;
- sets the administrator’s phone number to 555-5555, fax number to 333-3333, and email address to admin@example.com;
- sets the administrator’s company name to 「Megacompany Inc.」, street address to 「45 Trail street」, city to 「New York」, ZIP code to 「10292」, and country to 「United States」.
plesk bin init_conf --init \
-default-ip 192.0.2.14 \
-netmask 255.255.255.0 \
-iface eth0 \
-ip-type shared \
-hostname example.com \
-shared_ips add:192.0.2.46,192.0.2.47 \
-name "John Doe" \
-passwd adminpass \
-phone 555-5555 \
-fax 333-3333 \
-email admin@example.com \
-company "Megacompany Inc." \
-address "45 Trail street" \
-city "New York" \
-zip 10292 \
-country US \
-state NY
示例 2:安裝許可證金鑰
以下命令會安裝額外的許可證金鑰:
plesk bin license -i AB1C23-4DEF56-7GHI89-JK1L23-MNP456 -additional-key true