1.安装pipphp
sudo yum -y install epel-release sudo yum -y install python-pip
*这种方式安装的supervisor不支持python3,因此不要升级pippython
2.安装supervisor(高版本会报错)nginx
pip install supervisor==3.3.0
3.生成配置文件laravel
echo_supervisord_conf > /etc/supervisord.conf
4.修改配置文件(laravel队列)socket
vi /etc/supervisord.conf
引入自定义配置文件 vagrant
[include] files = /etc/supervisord.conf.d/*.conf
*include前的分号必定要去掉rest
配置文件内容:code
[program:xxx] autorestart=true directory=/vagrant_data/laravel command=php artisan queue:work --daemon --env=local process_name=%(process_num)s numprocs=1 stdout_logfile=/var/log/queue/laravel.log stderr_logfile=/var/log/queue/error.laravel.log
5.配置Web访问server
[inet_http_server] port=127.0.0.1:9010
*inet_http_server前的分号必定要去掉队列
Nginx配置
server { listen 80; server_name sup.xxx.local; access_log /var/log/nginx/sup.access.log main; error_log /var/log/nginx/sup.error.log; location / { proxy_pass http://127.0.0.1:9010; proxy_set_header Host $host; } }
启动
supervisord -c /etc/supervisord.conf
查看状态
supervisorctl status
从新加载supervisor(当修改supervisord.conf使用)
supervisorctl reload
1.Unlinking stale socket /tmp/supervisor.sock
解决:
sudo unlink /tmp/supervisor.sock