It shares a similar objective with programs such as launchd, daemontools, and runit. However, unlike these programs, it is not designed to replace the init process as the primary process (process ID 1). Instead, it is intended to be utilized for controlling processes that are related to a specific project or customer and can be initiated just like any other program during boot time.
In the following steps, we will guide you through the installation process of supervisor on a Debian server.
In your SSH, as root, run:
Code: Select all
apt-get update
apt-get -y install supervisor mc
mcedit /etc/supervisor/conf.d/PROJECTNAME.conf
Code: Select all
[program:PROJECTNAME]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php8.1 /home/SOMEUSER/web/DOMAIN.COM/public_html/artisan queue:work --timeout=0
autostart=true
autorestart=true
numprocs=8
user=SOMEUSER
redirect_stderr=true
stdout_logfile=/home/SOMEUSER/worker.log
stopwaitsecs=3600
Also addapt 'command' line, maybe you are not using 'artisan' as presented in previous example.
Also check what PHP version you are using, maybe it's not php8.1 as presented in previous example.
At the end reload supervisor by running the following in your SSH:
Code: Select all
supervisorctl reread
supervisorctl update