Vesta cesspit

From eddynetweb's cesspit
Jump to navigation Jump to search

Issue

I was recently configuring VestaCP to bind to a specific sub-domain without requiring a port when I came across the following issue:

502 Bad Gateway

Looking around, I found a solution.

Solution

Simply visit the below directory with your choice of text editor:

/usr/local/vesta/php/etc/php-fpm.conf

Then simply look for the following block:

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
listen.owner = admin
listen.group = admin
listen.mode = 0660

...and change listen.group = admin to listen.group = www-data

Why? The web server by default will attempt to read the directory, and since www-data had not been given authorization, it will return a 502 Gateway error. Changing it to www-data will allow apache2 to read the VestaCP directory.