# 创建第二个类似 app.yml 的文件是否足以支持多站点？

**URL:** https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362
**Category:** Self-hosting
**Tags:** hosting
**Created:** [2020年三月24日 07:55 UTC](https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362 "2020-03-24T07:55:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kuba-orlik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuba-orlik/32/318490_2.png) [@kuba-orlik](https://meta.discourse.org/u/kuba-orlik)
#### Post date: [2020年三月24日 07:55 UTC](https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362/1 "2020-03-24T07:55:41Z")

</div>

我试图在我的机器上创建 Discourse 的第二个实例，并通过反向代理在不同的域名上提供该服务。

我是否可以直接将当前的 `app.yml` 文件复制到 `app2.yml` 文件，修改需要更改的部分，然后运行 `./launcher build app2`？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2020年三月24日 11:52 UTC](https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362/2 "2020-03-24T11:52:37Z")

</div>

是的，你可以这样做。但我建议花点时间 [将 Web 和数据容器分离](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413)，这样你只需要运行一个 Redis 实例和一个 Postgres 实例。但如果你不在意浪费一些内存，也不需要在重建时减少停机时间的好处，那么你的想法也是可行的。

与多站点设置相比，这会占用稍多的内存，但允许你拥有不同的插件集。

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [2020年六月3日 17:06 UTC](https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362/3 "2020-06-03T17:06:37Z")

</div>

> [@kuba-orlik](#):
>
> 我尝试在我的机器上创建第二个 Discourse 实例，并通过反向代理在不同的域名上提供访问。

这听起来对我很有帮助。我可以将两台主机合并为一台（稍大一点的）主机，从而降低成本。

如果你成功了，我非常希望能看到关于你配置的描述。我是一名经验丰富的 Linux 管理员，但在这个领域缺乏经验。

> [@pfaffman](#):
>
> 我建议花更多时间将 Web 容器和数据容器分离。

我理解你的意思，但过去我已经多次看到这种建议，所以我更感兴趣的是更简单的方案。我的两个论坛规模都很小，流量也不高。

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2020年六月3日 17:17 UTC](https://meta.discourse.org/t/is-creating-a-second-app-yml-like-file-enough-for-multisite/145362/4 "2020-06-03T17:17:25Z")

</div>

在这种情况下，是的，复制一份 `samples/standalone.yml` 即可——但请注意：务必将 `/var/discourse/shared/[standalone]/` 以及其他主机暴露的资源更新为另一个名称。
