我正在努力奔跑立方体岩使用自己的用户名 cuberite。然而,当我
sudo -u cuberite ./Cuberite
我无法通过我的网络浏览器连接到它:
$ sudo lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Cuberite 1091 ubuntu 25u IPv6 469693 0t0 TCP *:http-alt (LISTEN)
$ netstat -nla | grep 8080
tcp6 0 0 :::8080 :::* LISTEN
但是如果我用自己的登录帐户(“ubuntu”)运行它,我就可以通过我的网络浏览器访问它:
$ sudo lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Cuberite 1152 ubuntu 25u IPv6 469908 0t0 TCP *:http-alt (LISTEN)
Cuberite 1152 ubuntu 26u IPv6 469909 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53169 (ESTABLISHED)
Cuberite 1152 ubuntu 27u IPv6 469911 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53170 (ESTABLISHED)
Cuberite 1152 ubuntu 28u IPv6 469913 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53171 (ESTABLISHED)
Cuberite 1152 ubuntu 29u IPv6 469915 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53173 (ESTABLISHED)
Cuberite 1152 ubuntu 30u IPv6 469917 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53172 (ESTABLISHED)
Cuberite 1152 ubuntu 31u IPv6 469919 0t0 TCP ip-172-29-30-22.ap-southeast-2.compute.internal:http-alt->123-243-56-42.static.tpgi.com.au:53174 (ESTABLISHED)
$ netstat -nla | grep 8080
tcp6 0 0 :::8080 :::* LISTEN
我的登录用户和用户 cuberite 之间有什么区别,导致这种行为不同?我如何找出这些帐户之间的差异?
答案1
您需要使用正确的协议进行连接。通过请求 HTTP 地址连接到端口 8080 上的 HTTPS 服务器(如果您的 URL 前面没有加上 HTTPS:// 就会发生这种情况)将超时,其行为与服务器根本没有运行一样。