EMQ 问答社区

emqx修改wss端口后启动失败

emqx修改wss端口后启动失败。附上日志

Exec: /usr/lib/emqx/erts-10.7/bin/erlexec -boot /usr/lib/emqx/releases/4.2.2/emqx -mode embedded -boot_var ERTS_LIB_DIR /usr/lib/emqx/erts-10.7/../lib -mnesia dir "/var/lib/emqx/mnesia/emqx@127.0.0.1" -config /var/lib/emqx/configs/app.2021.06.24.18.00.12.config -args_file /var/lib/emqx/configs/vm.2021.06.24.18.00.12.args -vm_args /var/lib/emqx/configs/vm.2021.06.24.18.00.12.args -start_epmd false -epmd_module ekka_epmd -proto_dist ekka -- console
Root: /usr/lib/emqx
/usr/lib/emqx
Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:2:2] [ds:2:2:8] [async-threads:4] [hipe]

Starting emqx on node emqx@127.0.0.1
Start http:management listener on 8081 successfully.
Start http:dashboard listener on 18083 successfully.
Start mqtt:tcp listener on 127.0.0.1:11883 successfully.
Start mqtt:tcp listener on 0.0.0.0:1883 successfully.
Start mqtt:ws listener on 0.0.0.0:8083 successfully.
Start mqtt:ssl listener on 0.0.0.0:8883 successfully.
2021-06-24 18:00:14.931 [error] Failed to start Ranch listener 'mqtt:wss:443' in ranch_ssl:listen([{cacerts,'...'},{key,'...'},{cert,'...'},{next_protocols_advertised,[<<"h2">>,<<"http/1.1">>]},{alpn_preferred_protocols,[<<"h2">>,<<"http/1.1">>]},{port,443},{backlog,1024},{send_timeout,15000},{send_timeout_close,true},{nodelay,true},{ciphers,["ECDHE-ECDSA-AES256-GCM-SHA384","ECDHE-RSA-AES256-GCM-SHA384","ECDHE-ECDSA-AES256-SHA384","ECDHE-RSA-AES256-SHA384","ECDHE-ECDSA-DES-CBC3-SHA","ECDH-ECDSA-AES256-GCM-SHA384","ECDH-RSA-AES256-GCM-SHA384","ECDH-ECDSA-AES256-SHA384","ECDH-RSA-AES256-SHA384","DHE-DSS-AES256-GCM-SHA384","DHE-DSS-AES256-SHA256","AES256-GCM-SHA384","AES256-SHA256","ECDHE-ECDSA-AES128-GCM-SHA256","ECDHE-RSA-AES128-GCM-SHA256","ECDHE-ECDSA-AES128-SHA256","ECDHE-RSA-AES128-SHA256","ECDH-ECDSA-AES128-GCM-SHA256","ECDH-RSA-AES128-GCM-SHA256","ECDH-ECDSA-AES128-SHA256","ECDH-RSA-AES128-SHA256","DHE-DSS-AES128-GCM-SHA256","DHE-DSS-AES128-SHA256","AES128-GCM-SHA256","AES128-SHA256","ECDHE-ECDSA-AES256-SHA","ECDHE-RSA-AES256-SHA","DHE-DSS-AES256-SHA","ECDH-ECDSA-AES256-SHA","ECDH-RSA-AES256-SHA","AES256-SHA","ECDHE-ECDSA-AES128-SHA","ECDHE-RSA-AES128-SHA","DHE-DSS-AES128-SHA","ECDH-ECDSA-AES128-SHA","ECDH-RSA-AES128-SHA","AES128-SHA"]},{keyfile,"/etc/emqx/certs/key.pem"},{certfile,"/etc/emqx/certs/cert.pem"},{reuse_sessions,true}]) for reason eacces (permission denied)

Failed to start mqtt:wss listener on 0.0.0.0:443 - eacces
![os_mon] memory supervisor port (memsup): Erlang has closed
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
{"Kernel pid terminated",application_controller,"{application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{eacces,[{emqx_listeners,start_listener,1,[{file,\"/emqx-rel/_checkouts/emqx/src/emqx_listeners.erl\"},{line,55}]},{lists,foreach,2,[{file,\"lists.erl\"},{line,1338}]},{emqx_app,start,2,[{file,\"/emqx-rel/_checkouts/emqx/src/emqx_app.erl\"},{line,39}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,277}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{eacces,[{emqx_listeners,start_listener,1,[{file,"/emqx-rel/_checkouts

Crash dump is being written to: /var/log/emqx/crash.dump...done

建议使用root用户启动,因为443是系统默认的HTTPS端口,如果需要使用433,需要root权限