ServerPilot 集成
概述
ServerPilot 是一个云服务,用于在 DigitalOcean、Amazon、Google 或任何其他服务器提供商的服务器上托管 WordPress 和其他 PHP 网站。此集成实现了 Ultimate Multisite 与 ServerPilot 之间的自动域名同步和 SSL 证书管理。
功能
- 自动域名同步
- 使用 Let's Encrypt 的 SSL 证书管理
- 自动 SSL 续期
要求
以下常量必须在您的 wp-config.php 文件中定义:
define('WU_SERVER_PILOT_CLIENT_ID', 'your_client_id');
define('WU_SERVER_PILOT_API_KEY', 'your_api_key');
define('WU_SERVER_PILOT_APP_ID', 'your_app_id');
设置说明
1. 获取您的 ServerPilot API 凭据
- 登录您的 ServerPilot 仪表盘
- 前往 “Account” > “API”
- 如果您还没有,请创建一个新的 API 密钥
- 复制您的 Client ID 和 API Key
2. 获取您的 App ID
- 在您的 ServerPilot 仪表盘中,前往 “Apps”
- 选择托管您的 WordPress multisite 的应用
- App ID 可在 URL 中查看:
https://manage.serverpilot.io/apps/{APP_ID}
3. 将常量添加到 wp-config.php
将以下常量添加到您的 wp-config.php 文件中:
define('WU_SERVER_PILOT_CLIENT_ID', 'your_client_id');
define('WU_SERVER_PILOT_API_KEY', 'your_api_key');
define('WU_SERVER_PILOT_APP_ID', 'your_app_id');
4. 启用集成
- 在您的 WordPress 管理后台,前往 Ultimate Multisite > Settings
- 导航至 “Domain Mapping” 选项卡
- 向下滚动至 “Host Integrations”
- 启用 ServerPilot 集成
- 点击 “Save Changes”
工作原理
域名同步
当在 Ultimate Multisite 中映射域名时:
- 集成从 ServerPilot 检索当前域名列表
- 将新域名添加到列表中(如适用,还会添加 www 版本)
- 通过 API 将更新后的列表发送至 ServerPilot
- ServerPilot 为您的应用更新域名列表