Laravel - Generic Apache 500 error with Envoyer directory structure

771 views Asked by At

I am trying to deploy my Laravel 5 site to my VPS using Envoyer. I changed the document root in the site's Apache settings to /current/public (settings below), when I do this I receive a generic Apache 500 error. If I use the old public directory, everything loads properly.

I also tried chmod 777 -R storage, no luck. There are no log entries in the Laravel log, everything deploys fine without errors.

I did notice that if I create a plain HTML document and deploy it via Envoyer, I am able to access it directly with the /current/public document root, anything related to Laravel (and only using current/public), results in the 500.

Ideas? Would a symlink be a possible solution? Oddly, my Forge configuration on my other Envoyer site has the document root set to public, yet there is no symlink to current/public that I can see. It may be set to current/public and just not displaying that for some reason.

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: [email protected]
serveralias: www.mydomain.org
servername: mydomain.org
usecanonicalname: 'Off'
user: eyf
userdirprotect: ''
1

There are 1 answers

0
NightMICU On BEST ANSWER

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.