使用 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