Joomla§
要使用 Unit 运行 Joomla 内容管理系统
使用 PHP 语言模块安装 Unit。
安装和配置 Joomla 的 先决条件。
安装 Joomla 的 核心文件。在此,我们将其安装在 /path/to/app/;在配置中使用真实路径。
运行以下命令,以便 Unit 可以访问 应用程序目录
# chown -R unit:unit /path/to/app/
有关包括权限在内的更多详细信息,请参见安全检查清单。
接下来,准备Joomla配置以进行单元测试(对share和root使用实际值)
{ "listeners": { "*:80": { "pass": "routes" } }, "routes": [ { "match": { "uri": [ "*.php", "*.php/*", "/administrator/" ] }, "action": { "pass": "applications/joomla/direct" } }, { "action": { "share": "/path/to/app$uri", "fallback": { "pass": "applications/joomla/index" } } } ], "applications": { "joomla": { "type": "php", "targets": { "direct": { "root": "/path/to/app/" }, "index": { "root": "/path/to/app/", "script": "index.php" } } } } }
第一个路由步骤处理管理部分和指定PHP脚本的所有URL;direct目标不会设置script选项以供默认使用,因此Unit会查找相应的.php文件。
下一步通过share提供静态文件。其fallback为搜索引擎友好型URL启用重写机制。所有请求都会转到在Joomla目录根目录下运行index.php脚本的index目标。
上传更新后的配置。假设上述JSON已添加到
config.json
# curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock https:///config/
成功更新后,Joomla应在侦听器的IP和端口上可用以完成设置