Install & Setup Supervisor
In this short snippet, you will learn how to install and manage Supervisor in Ubuntu machine. The steps is very straight forward so let's get started.
Step 1: Install Supervisor in Linux
Ubuntu
To install supervisor in ubuntu you can use "apt-get" command line. Do note that you need to use "sudo" in order to run this command.
CentOS
To install supervisor in centOS (used by most whm server) you can use "yum" command line. Do note that you need to use "sudo" in order to run this command.
Then start and enable the supervisord daemon to start on boot using the commands below:
Step 2: Supervisor Configuration
The supervisor configuration can be located in "/etc/supervisor/conf.d" or "/etc/supervisord.d" (in centOS) and from within this directory, you can create as many configurations as you like.
For this example, we'll set up Laravel Queue supervisor configuration. To create a new file from within the supervisor config directory called "queue_manager.conf" or "queue_manager.ini" and the content of the file should be as follows.
Create the config file using the command below:
Ubuntu
CentOS
Then paste the follow code in the file:
In the code above, you have to replace the following with the right values on your server: PATH_TO_YOUR_BACKEND replace with the directory path of where you backend files is location, usually its something like home/USERNAME/public_html
user=forge, change it to the user you are logged in in your terminal, usually is root user, so you can set: user=root
Step 3: Start Supervisor
Once you have created the configuration, you can start the supervisor process. To start supervisor you can run the following commands.
Step 4: Start the queue
Run the command below to start just the laravel_queue you just created above
Note: If nothing works after run the command above, you can rather run the command below, to make supervisor start all queue:
Done!!
Last updated