Skip to content

配置说明

配置文件存放在config/workerman.php

return [
    'terminal' => [
        // 协议
        'protocol' => 'http',
        // 监听地址
        'ip' => '0.0.0.0',
        // 监听端口
        'port' => 30001,
        // 进程名称
        'name'  => 'tmTerminalWorker',
        // 进程数
        'count' => 1,
    ],
];

执行命令

提供终端执行命令服务


【启动服务】
命令: php think terminal start

【守护进程方式启动服务】
命令: php think terminal start -d

【停止服务】
命令: php think terminal stop

【重启服务】
命令: php think terminal restart

【平滑重启服务】
命令: php think terminal reload

【查看服务状态】
命令: php think terminal status

【查看服务连接状态】
命令: php think terminal connections

日志存储

日志存储在 runtime/workerman/log 目录下, 按年月日命名.log文件

程序进程id存储在 runtime/workerman/server.id 文件中

配置反向代理

在nginx配置文件中添加,访问地址:域名+ /terminal

location /terminal
{
    proxy_pass http://127.0.0.1:30001;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-real-ip $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
}

请参照以下配置:

alt image

Released under the Apache-2.0 License.