GateWayWorker 部署

GateWayWorker 部署注意事项

  1. GateWayWorker/Applications/metu/Events.php onWorkerStart 设置数据库连接
  2. 服务注册地址:Applications/start_businessworker.php 设置端口
  3. 设置内部端口号:Applications/start_gateway.php 设置端口
  4. 设置协议端口号:Applications/start_register.php 设置端口
  5. 配置网站ssl
  6. 更换证书路径 Application/start_gateway.php
    GateWayWorker 部署_第1张图片
    伪静态修改,添加nginx 代理
# websockets
location /socket/ {
    proxy_pass http://127.0.0.1:32321;           
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
}

添加有伪静态访问: ws://域名/socket/

命令

  1. php start.php start 以debug(调试)方式启动
  2. php start.php start -d 以daemon(守护进程)方式启动
  3. php start.php stop 停止
  4. php start.php restart 重启
  5. php start.php reload 平滑重启
  6. php start.php status 查看状态

报错

  1. SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown
    解决:你可以改成通过nginx或者apache代理ssl。或者通过改workerman源码把workerman的sslv3打开,位置GatewayWorker/vendor/workerman/workerman/Connection/TcpConnection.php
    代码
if($async){
    $type = STREAM_CRYPTO_METHOD_SSLv2_CLIENT | STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
}else{
    $type = STREAM_CRYPTO_METHOD_SSLv2_SERVER | STREAM_CRYPTO_METHOD_SSLv23_SERVER;
}

改成

if($async){
    $type = STREAM_CRYPTO_METHOD_SSLv2_CLIENT | STREAM_CRYPTO_METHOD_SSLv23_CLIENT | STREAM_CRYPTO_METHOD_SSLv3_CLIENT;
}else{
    $type = STREAM_CRYPTO_METHOD_SSLv2_SERVER | STREAM_CRYPTO_METHOD_SSLv23_SERVER | STREAM_CRYPTO_METHOD_SSLv3_SERVER;
}

重启服务(注意:要使用域名访问,我这使用ip还是报错)

你可能感兴趣的:(宝塔,服务器,php,https)