无法使用supervisor启动laravel-echo-server

时间:2018-01-16 03:07:16

标签: linux laravel supervisord

我的项目位于/var/www/html/bcbAPIlaravel-echo-server.json文件位于usr/bin

我的laravel-worker.conf文件

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/bcbAPI/artisan queue:work --queue="emails, queue, queue2" --tries=1  --daemon
autostart=true
autorestart=true
user=root
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/html/bcbAPI/storage/logs/worker.log

[program:laravel-worker2]
process_name=%(program_name)s_%(process_num)03d
command=/usr/bin/laravel-echo-server laravel-echo-server start --dir=/var/www/html/bcbAPI
autostart=true
autorestart=true
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/bcbAPI/storage/logs/echoserver.log
stderr_logfile=/var/www/html/bcbAPI/storage/logs/echoserver-error.log

我试过的其他方式

[program:laravel-worker2]
process_name=%(program_name)s_%(process_num)03d
directory=/var/www/html/bcbAPI
command=/usr/bin/laravel-echo-server start
autostart=true
autorestart=true
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/bcbAPI/storage/logs/echoserver.log

跑步主管

sudo supervisorctl reread

sudo supervisorctl update

sudo supervisorctl start laravel-worker:*

日志文件为空。我究竟做错了什么?如果我在usr/bin目录

,我可以启动服务器

1 个答案:

答案 0 :(得分:0)

首先,您需要全局see here for more detaillaravel-echo-server.json全局安装laravel-echo-server,并将其放置在项目根目录中。

然后,您需要创建两个主管配置。一个用于队列,另一个用于laravel echo服务器,例如波纹管:

laravel-queue-worker.conf

[program:laravel-queue-worker]
process_name=%(program_name)s
command=php **project_absolute_path**/artisan horizon
autostart=true
autorestart=true
user=rana
redirect_stderr=true
stdout_logfile=/var/log/laravel-queue-worker.log

laravel-echo-server.conf

[program:laravel-echo-server]
process_name=%(program_name)s
command=laravel-echo-server start --dir=**project_absolute_path**
autostart=true
autorestart=true
user=rana
redirect_stderr=true
stdout_logfile=/var/log/laravel-echo-server.log

**项目绝对路径示例:/var/www/html/laravel **