Supervisor不会运行/ usr / bin中的文件,但是如果我将其CD并手动运行,则可以运行它

问题描述 投票:0回答:1

我无法让主管在我的Ubuntu 16.04 AWS EC2实例上运行laravel回显服务器,但它在我的Homestead Ubuntu 16.04 VM上运行良好。我得到的错误是找不到命令'/ usr / bin / laravel-echo-server。如果我直接CD /usr/bin并运行laravel-echo-server start,它将以开发人员模式启动就好了

我正在运行节点V8.9.1

这是我的配置文件中的内容

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)04d
command=/usr/bin/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

laravel-echo-server.json

{
    "authHost": "http://myip.com/b3",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "aa41c60c83ffa7f7",
            "key": "70e24d91c54f9f30d1fbdb2ed3f2cce8"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
                "port": "6379",
                "host": "localhost"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {
        "wsEngine": "uws"
    },
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "myiphere/b2",
        "allowMethods": "GET,POST,PUT",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}
laravel supervisord
1个回答
0
投票

在开始之前,请检查NodeJSlaravel-echo-server的绝对路径:

which node
which laravel-echo-server

将nodejs和laravel-echo-server PATH添加到您的命令后:

command=/bin/node /bin/laravel-echo-server start --dir=YOUR_ABSOLUTE_PROJECT_PATH

问题已解决!

© www.soinside.com 2019 - 2024. All rights reserved.