-
Create the following folder structure in your root project directory: .ebextensions/supervisor
-
Place the supervisor.config under .ebextensions/
-
Place the setup.sh under .ebextensions/supervisor/
-
Run "chmod +x .ebextensions/supervisor/setup.sh"
-
Place the supervisord.conf under .ebextensions/supervisor/
-
Place the supervisor_laravel.conf under .ebextensions/supervisor/
Feel free to update the files according to your needs. You mostly will need to change the command inside the supervisor_laravel.conf file
If you want to check if the supervisor is running, connect to the instance and run "supervisorctl status". If you want stop/kill supervisor run "ps aux | grep "[/]usr/bin/supervisord", get the PID and then run "kill PID_NUMBER"
If someone is struggling with the error "/bin/sh: .ebextensions/supervisor/setup.sh: /bin/bash^M: bad interpreter: No such file or directory" is because you're uploading using
eb deploy
from windows and the ZIP file encodes newlines in windows format (CRLF), note the "^M" after "bash".To fix that, I've added new commands to supervisor.config
The first command adds the execution bit to the file in case it doesn't have it. The second (both a and b) removes those windows newlines (sincerely I don't know wich one fixes it, but I've left both and it works).