Skip to content

Consumers Configuration and Installation

Firewall Configuration

Inbound Rules

Type Protocol Port Range Sources
SSH TCP 22 141.98.24.21, 141.98.24.22, 152.89.76.109, 152.89.76.110, 152.89.76.111, 185.22.211.0/24, 185.69.56.208, 185.69.56.209, 185.69.56.210, 2a03:2800:0300::/64, Bastion (tag)

Outbound Rules

Type Protocol Port Range Destinations
ICMP ICMP All ports All IPv4, All IPv6
All TCP TCP All ports All IPv4, All IPv6
All UDP UDP All ports All IPv4, All IPv6

Installation on Ubuntu 24.04

Install Supervisor

apt-get update -y
apt-get install supervisor -y
systemctl status supervisor

Connect customer documents filesystem

(used by commands consumer) Follow instructions on webserver

Add user www-data to www-data group

usermod -G www-data www-data

Deploying from DeployHQ

Create a server deployment from the Method Grid app repository to the consumer server.

Follow DeployHQ's instructions for giving DeployHQ access to the server, then set the following options: - Deployment path: /var/www/vhosts/app.methodgrid.com/httpdocs - Environment: production - Subdirectory to deploy from: httpdocs/app

Deploy the code.

Configuration

Create Consumer Supervisor .conf Files

Create log directory:

mkdir /var/log/consumer

Activity Log

Create /etc/supervisor/conf.d/activity-log.conf with the following content:

[program:activitylog]
command=php /var/www/vhosts/app.methodgrid.com/httpdocs/console/cli.php app:consumer:activitylog -v --loglevel=4 --env=production
autostart=true
autorestart=true
stderr_logfile=/var/log/consumer/activitylog.error.log
stdout_logfile=/var/log/consumer/activitylog.log

Notifications

Create /etc/supervisor/conf.d/notifications.conf:

[program:notifications]
command=php /var/www/vhosts/app.methodgrid.com/httpdocs/console/cli.php app:consumer:notifications --sendDelay=600 -v --loglevel=4 --env=production
autostart=true
autorestart=true
stderr_logfile=/var/log/consumer/notifications.error.log
stdout_logfile=/var/log/consumer/notifications.log

Cache Invalidation

Create /etc/supervisor/conf.d/cache-invalidation-on-scheduling.conf:

[program:cache-invalidation-on-scheduling]
command=php /var/www/vhosts/app.methodgrid.com/httpdocs/console/cli.php app:consumer:cache-invalidation-on-scheduling -v --loglevel=4 --env=production
autostart=true
autorestart=true
stderr_logfile=/var/log/consumer/cache-invalidation-on-scheduling.error.log
stdout_logfile=/var/log/consumer/cache-invalidation-on-scheduling.log

Commands

Create /etc/supervisor/conf.d/commands.conf:

[program:commands]
command=php /var/www/vhosts/app.methodgrid.com/httpdocs/console/cli.php app:consumer:commands --env=production
user=www-data
autostart=true
autorestart=true
stderr_logfile=/var/log/consumer/commands.error.log
stdout_logfile=/var/log/consumer/commands.log

Restart Supervisor

systemctl restart supervisor && systemctl enable supervisor

Verify that all consumers are running

supervisorctl status
Last modified by: Unknown