运行自动化安装
若要安装 Plesk 而不需要用户任何输入,可运行以下命令:
plesk-installer <packages source options> --select-release-id <ID> <components installation options> [other options]
其中
- 程序包来源选项定义安装程序应获取并安装 Plesk 程序包的位置
<packages source options> =
--source <URL>
若使用 Plesk 更新服务器镜像
或
--source VPS dashboard
若使用本地文件系统
或
无
若从 Plesk 更新服务器安装
-
--select-release-ID
选项定义应安装的 Plesk 版本。<ID>
是唯一的 Plesk 版本标识符,如 PLESK_12_0_18。
您可以通过--show-releases
选项运行安装程序获取可用的 Plesk 版本 ID 列表。注意,默认安装程序只会向您显示公开发行的生产版本的 ID(了解更多有关 Plesk 版本层级的信息请参阅 安装 Plesk 之前 小节)。如果您想要获取包括产品预览版和测试版在内的所有 Plesk 版本的列表,请添加--skip-branch-filter
选项。 - 组件安装选项定义要安装哪些 Plesk 组件
<components installation options> =
--installation-type
安装类型可以是
全部
或典型
。或
--install-component component1 [--install-component component2 [... [--install-component componentN]]]
您可以通过以下选项运行安装程序获取某个版本可用的所有组件的列表:
--select-release-id <ID> --show-components
- 其他选项包括定义代理服务器设置、安装日志等等。如需详情,请参阅 附录 D: Plesk 安装程序选项。
修改默认安装路径(Windows)
在 Windows 上安装 Plesk 灵活性更强:能够让用户通过命令行修改默认的安装路径。由 --set-option
key 授权的定制化。--set-option
的值应该为 "key=value",其中 key 是一个指定 Plesk 数据部分的常量,而该值是您希望能够找到这些数据的路径。目前有以下 key 可用:
- PLESK_INSTALLDIR. 该 key 指定随着时间微更改的 Plesk 数据部分。这包括应用程序代码、配置文件、工具等等。
- PLESK_DATADIR. 该 key 指定随着时间大更改的 Plesk 数据部分。这包括客户数据库、APS 程序包、日志文件等等。
- PLESK_VHOSTSDIR. 该 key 指定将保存您所有客户域名内容的路径。这通常是占 Plesk 内容最大的一部分。
此样本演示了如何使用 --set-option
key:
plesk-installer.exe --select-product-id panel --select-release-id PANEL_12_0_18_WIN --install-component base --install-component management --install-component spamassassin --install-component webalizer --install-component drweb --set-option "PLESK_INSTALLDIR=C:\Plesk Dir" --set-option "PLESK_DATADIR=C:\Plesk Data" --set-option "PLESK_VHOSTSDIR=C:\Plesk Vhosts"
如,Linux/Unix
1.以下命令会从能够通过 HTTP 访问的服务器 mirror.example.com
上设置的镜像安装 Plesk 12 (版本 ID 是 PANEL_12_0_18
)。安装文件暂时存储在 /tmp/panel,安装状态将会报告至 admin@example.com 邮件地址。安装的组件是基本的 Plesk 程序包、PostgreSQL 服务器和 SpamAssassin 垃圾邮件过滤器。
./plesk-installer --source http://mirror.example.com/ --target /tmp/panel --select-release-id PANEL_12_0_18 --install-component base --install-component postgresql --install-component spamassassin --notify-email admin@example.com
2.下面命令执行来自 Plesk 更新服务器上的 Plesk 12(版本号为PANEL_12_0_18
)的完整安装(安装所有可用的产品组件)。所有安装程序输出会重定向到 XML 文件。
./plesk-installer --select-release-id PANEL_12_0_18 --install-everything --enable-xml-output
示例 Windows
1.以下命令会从能够通过 HTTP 访问的服务器 mirror.example.com
上设置的镜像安装 Plesk 12 (版本 ID 是 PANEL_12_0_18_WIN
)。安装文件暂时存储在%SystemDrive%\Parallels\
文件夹,安装状态将会报告至 admin@example.com 邮件地址。安装的组件是基本的 Plesk 程序包、Bind 域名服务器、MailEnable 邮件服务器、PHP 脚本引擎、 Presence Builder 和 Horde Webmail。
plesk-installer.exe --source http://mirror.example.com/ --target %SystemDrive%\Parallels --select-release-id PANEL_12_0_18_WIN --install-component base --install-component dns --install-component mailenable --install-component php5 --install-component sitebuilder --install-component webmail --notify-email admin@example.com
2.下面命令执行来自 Plesk 更新服务器上的 Plesk 12(版本号为PANEL_12_0_18_WIN
)的完整安装(安装所有可用的产品组件)。所有安装程序输出会重定向到 XML 文件。
plesk-installer.exe --select-release-id PANEL_12_0_18_WIN --install-everything --enable-xml-output