Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### 1. Installing Supervisor on Linux
- To install supervisor, use the following command.
- ```sudo apt-get install supervisor```
- #### 2. Supervisor configuration for Laravel
- After installation, create supervisor configuration file with instructions to run the processes. To create a configuration file, execute the following command.
- ```sudo nano /etc/supervisor/conf.d/project-name-queue-worker.conf```
- ```
- [program:project-name-queue-worker]
- process_name=%(program_name)s_%(process_num)02d
- command=php /path/to/project/artisan queue:work
- autostart=true
- autorestart=true
- user=root
- numprocs=3
- redirect_stderr=true
- stdout_logfile=/path/to/project/storage/logs/queue-worker.log
- ```
- #### 3. Starting Supervisor
- Now to start the queue worker.
- ```
- sudo supervisorctl reread
- sudo supervisorctl update
- sudo supervisorctl start laravel-queue-worker:*
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement