Comment on page
Installing Supervisor
Supervisor is a process control system used to ensure that the Laravel Queues used by Elentra are running. You must install and configure Supervisor on any environment running Elentra, but doing the following:
- 1.Install the required Supervisor package:yum install supervisorsystemctl enable supervisordsystemctl start supervisord
- 2.Edit the main configuration file at
/etc/supervisord.conf
and make the following changes to allow control over Supervisor by non-root users. Modify the[unix_http_server]
section Set the value ofchmod
to0770
in order give access users who are in the same group and then add a new option calledchown
and set it to the usernobody
and groupapache
. If Apache is not running as the groupapache
, please substitute this accordingly.[unix_http_server]file=/var/run/supervisor.sock ; (the path to the socket file)chmod=0770 ; sockef file mode (default 0700)chown=nobody:apacheModify the[supervisorctl]
section Supervisor must be configured to communicate over a Unix socket.[supervisorctl]serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket - 3.Add the
staging
andproduction
users to theapache
group.usermod -G apache -a productionusermod -G apache -a staging - 4.Create a new file in the
/etc/supervisor.d
directory calledelentra.ini
, and use the following template snippet as a reference to create your own file.Please make sure that you have the correct path incommand
andstdout_logfile
, and thatuser
is the correct system account that your existing cron jobs are run as.[program:staging]process_name=%(program_name)s_%(process_num)02dcommand=php /var/www/vhosts/staging.elentra.med.university.edu/current/www-root/core/library/vendor/elentrapackages/elentra-1x-api/artisan queue:work --queue=high,emails,default,low --env=stagingautostart=trueautorestart=trueuser=stagingnumprocs=1redirect_stderr=truestdout_logfile=/var/www/vhosts/staging.elentra.med.university.edu/storage/logs/worker.log[program:production]process_name=%(program_name)s_%(process_num)02dcommand=php /var/www/vhosts/elentra.med.university.edu/current/www-root/core/library/vendor/elentrapackages/elentra-1x-api/artisan queue:work --queue=high,emails,default,low --env=productionautostart=trueautorestart=trueuser=productionnumprocs=1redirect_stderr=truestdout_logfile=/var/www/vhosts/elentra.med.university.edu/storage/logs/worker.log[group:elentra]programs=staging,production - 5.Restart Supervisor:systemctl restart supervisord
Last modified 3yr ago