workermna配置wss服务,注意通过宝塔的配置

1,apache


    ServerAdmin webmasterexample.com
    DocumentRoot "/www/wwwroot/daan163.com/"
    ServerName SSL.daancity.com
    ServerAlias www.daancity.com daancity.com 
    errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/daancity.com-error_log"
    CustomLog "/www/wwwlogs/daancity.com-access_log" combined
    
    #SSL
    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/daancity.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/daancity.com/privkey.pem
    SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
    SSLProtocol All -SSLv2 -SSLv3
    SSLHonorCipherOrder On
    
  
    
# Proxy Config
SSLProxyEngine on

ProxyRequests Off
ProxyPass /wss ws://127.0.0.1:8071
ProxyPassReverse /wss ws://127.0.0.1:8071

 

 

如果是apache的8072多群

# Proxy Config
SSLProxyEngine on

ProxyRequests Off
ProxyPass /wss2 ws://127.0.0.1:8072
ProxyPassReverse /wss2 ws://127.0.0.1:8072

 

注意php版本要取消某些函数的禁用

pcntl_fork   /  pcntl_signal_dispatch  /  pcntl_wait  /  pcntl_signal  /  pcntl_alarm

 

看云在线文档:https://www.kancloud.cn/bluestear/mdkeji_chat/1413237

多群版关闭ws
cd /www/wwwroot/www.mdkeji.cn/addons/mdkeji_chat/extend/Workerman-master/ && php start.php stop

多群版启动ws
cd /www/wwwroot/www.mdkeji.cn/addons/mdkeji_chat/extend/Workerman-master/ && php start.php start -d

 

 

2,nginx

  location /wss
  {
    proxy_pass http://127.0.0.1:8071;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header X-Real-IP $remote_addr;
  }

你可能感兴趣的:(php)