# 在包含CPanel和Apache的虚拟机上安装困难

**URL:** <https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [2025年三月20日 14:25 UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157 "2025-03-20T14:25:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Gustavo\_Rip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gustavo_rip/32/489281_2.png) [@Gustavo\_Rip](https://meta.discourse.org/u/Gustavo_Rip)\
**Post date:** [2025年三月20日 14:25 UTC](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157/1 "2025-03-20T14:25:45Z")

</div>

**大家好！**

**这是我的第一篇帖子。**

**我是 phpBB 的新 Discourse 用户。**  
**两周前，我使用 Nginx 在 Docker 容器中安装了 Discourse，因为 Apache 默认使用端口 80 和 443。我仔细遵循了安装指南和 Nginx 多站点配置中的步骤。**

**我能够运行并使用论坛一周，只是偶尔登录以熟悉该平台。当我让一位用户注册并测试时，论坛在第二天崩溃了。浏览器显示消息：“为该讨论论坛提供支持的软件遇到了意外问题。” 我无法修复它，因此我从头开始重新安装了整个论坛，然后从最后一个可用备份中恢复了帖子。这是上周四。在此之后，论坛恢复正常运行。现在，它再次出现 502 Bad Gateway Nginx 错误。我直接进行了重建应用程序，但它再次崩溃并出现错误：**

`Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate' failed with return #&lt;Process::Status: pid 580 exit 1&gt;`

**上周同样的事情一次又一次地发生，这导致我从头开始重新安装一切。论坛几乎不活跃，因为我还没有公开它。我担心如果它在没有活动的情况下持续崩溃，那么当用户群体更大时会发生什么？运行这些命令：./launcher enter app**

```plaintext
**cd /var/www/discourse**
 **su discourse -c 'bundle exec rake db:migrate'**

```

**在响应中，我看到了这个引起我注意的内容：**

`connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: the database system is starting up`

**我尝试手动重启 Postgres 并再次运行重建，但进程再次被中断，并出现此错误消息：**

```plaintext
FAILED
--------------------
Pups::ExecError: if [-f /root/install_postgres]; then
/root/install_postgres &amp;&amp; rm -f /root/install_postgres
elif [-e /shared/postgres_run/.s.PGSQL.5432]; then
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 &amp;&amp; echo postgres already running stop container ; exit 1
fi
 failed with return #&lt;Process::Status: pid 18 exit 1&gt;
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"tag"=&gt;"db", "cmd"=&gt;"if [-f /root/install_postgres]; then\n /root/install_postgres &amp;&amp; rm -f /root/install_postgres\nelif [-e /shared/postgres_run/.s.PGSQL.5432]; then\n socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 &amp;&amp; echo postgres already running stop container exit ; 1\nfi\n"}
bootstrap failed with exit code 1

```

**我并不是一个经验丰富的用户，无法识别错误，但我怀疑 Postgres 最终会崩溃。这导致我上周重新启动一切并从头开始，但我认为这对任何人来说都不是常见或健康的做法。**

**Discourse 运行在一个拥有 4 核、6GB RAM 和 180GB 磁盘空间的服务器上。我目前只运行这个 Discourse 安装，据我所知，我没有受到硬件限制。**

---

_[View the full topic](https://meta.discourse.org/t/difficulty-installing-on-vm-that-includes-cpanel-and-apache/358157)._
