phpBB§
使用 Unit 运行 phpBB 公告板
使用 PHP 语言模块安装 Unit。
安装并配置 phpBB 的 先决条件。
安装 phpBB 的 核心文件。在此,我们将其安装在 /path/to/app/;在配置中使用真实路径。
运行以下命令,以便 Unit 可以访问 应用程序目录
# chown -R unit:unit /path/to/app/
有关更多详细信息,包括权限,请参阅 安全检查清单。
接下来,为 Unit 准备应用 配置(对 share 和 root 使用真实值)
{ "listeners": { "*:80": { "pass": "routes" } }, "routes": [ { "match": { "uri": [ "/cache/*", "/common.php*", "/config.php*", "/config/*", "/db/migration/data/*", "/files/*", "/images/avatars/upload/*", "/includes/*", "/store/*" ] }, "action": { "return": 404 } }, { "match": { "uri": [ "/", "*.php", "*.php/*" ] }, "action": { "pass": "applications/phpbb/direct" } }, { "action": { "share": "/path/to/app$uri", "fallback": { "pass": "applications/phpbb/index" } } } ], "applications": { "phpbb": { "type": "php", "targets": { "direct": { "root": "/path/to/app/" }, "index": { "root": "/path/to/app/", "script": "app.php" } } } } }
注意
pass 目标之间的区别在于它们对 script 设置 的使用
direct 目标从 URI 运行 .php 脚本,如果 URI 省略该脚本,则默认为 index.php。
index 目标指定 Unit 为目标接收的任何 URI 运行的 script。
上传更新的配置。假设上述 JSON 已添加到
config.json
# curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock http://localhost/config/
更新成功后,您的应用应可在侦听器的 IP 地址和端口上使用
浏览至 /install/app.php 完成您的安装。完成此操作后,删除 install/ 子目录以降低安全风险
$ rm -rf /path/to/app/install/