1

我正在尝试使用 Envoyer 将我的 Laravel 5 站点部署到我的 VPS。我将站点的 Apache 设置中的文档根更改为/current/public(下面的设置),当我这样做时,我收到一个通用的 Apache 500 错误。如果我使用旧public目录,一切都会正确加载。

我也试过chmod 777 -R storage了,没有运气。Laravel 日志中没有日志条目,一切都部署得很好,没有错误。

我确实注意到,如果我创建一个纯 HTML 文档并通过 Envoyer 部署它,我可以直接使用/current/public文档根目录访问它,与 Laravel 相关的任何内容(并且仅使用current/public)都会导致 500。

想法?符号链接会是一个可能的解决方案吗?奇怪的是,我在另一个 Envoyer 站点上的 Forge 配置将文档根设置为public,但current/public我看不到任何符号链接。由于某种原因,它可能被设置为current/public并且只是不显示。

customlog:
  -
    format: combined
    target: /usr/local/apache/domlogs/mydomain.org
  -
    format: "\"%{%s}t %I .\\n%{%s}t %O .\""
    target: /usr/local/apache/domlogs/mydomain.org-bytes_log
documentroot: /home/eyf/current/public
group: eyf
hascgi: 1
homedir: /home/eyf
ifmoduleconcurrentphpc: {}

ifmodulemodsuphpc:
  group: eyf
ip: MY.IP.ADDR
owner: root
phpopenbasedirprotect: 1
port: 80
scriptalias:
  -
    path: /home/eyf/public/cgi-bin
    url: /cgi-bin/
  -
    path: /home/eyf/public/cgi-bin/
    url: /cgi-bin/
serveradmin: webmaster@mydomain.org
serveralias: www.mydomain.org
servername: mydomain.org
usecanonicalname: 'Off'
user: eyf
userdirprotect: ''
4

1 回答 1

1

Okay, so I encountered two separate problems here.

The first problem was the fact that I was deploying code as root and trying to access a site owned by a cPanel user (eyf in this case). Because the files/directories were deployed as root, an ownership issue caused the generic 500 error page.

I then tried to connect via Envoyer with eyf and there was some sort of SSH key issue - even though I added the key to eyf via cPanel, it did not seem to take. Repeated attempts to connect from Envoyer eventually lead the IP address to be blacklisted.

In response to this, Envoyer simply said "Failed" when trying to connect to the server. Immediately after saying "Failed," a warning message would appear saying that there was a problem with PHP-FPM.

Taylor says that this PHP-FPM warning message appears because the connection was unsuccessful and Envoyer could not connect to PHP-FPM. Well, this is totally misleading because I do not have PHP-FPM installed on this server and it has absolutely nothing to do with why the connection failed (it was an SSH authentication problem).

I asked him to please improve the warnings/errors for things like this, it stretched what should have been a quick fix into a several hour long tail chasing session. Dploy.io, a competitor, clearly showed an SSH connection issue when I first attempted to connect and had forgot the SSH key - "d'oh! Let me fix that," problem solved in less than a minute.

Anyway, back to Envoyer bliss - just a bit ticked. ;) The IP addresses were whitelisted, I added the SSH key manually for the cPanel user (/.ssh/id_rsa), and now everything works.

于 2015-04-17T15:01:37.463 回答