Tomcat 适用于端口 :443 而不适用于 :80 尽管启用了防火墙

Tomcat works with port :443 and doesn't with :80 despite of enabling firewall

我的 Tomcat 连接器有问题。当我尝试使用 SSL 连接时,它工作正常并且我可以访问该页面 (https://nombritech.pl). I would like to be able to be redirected from port 80 to 443, but if I try to connect with http I cannot access the page (http://nombritech.pl)。

我指定的这些连接器有问题吗?我想我做的一切都像我在其他线程中看到的那样。

<Connector port="80" redirectPort="443" protocol="HTTP/1.1" connectionTimeout="20000" />
    <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" KeystoreFile="/opt/tomcat/certificate/nombritech.pl.keystore" keystorePass="pass" />

我看不到任何通过端口 80 的流量:

我在 Ubuntu 17.10 和 Tomcat 9 beta 2 上 运行 测试这个。

编辑:我认为它可能 运行ning 在 ipv6 而不是 ipv4 上:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      23950/systemd-resol
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1151/dnsmasq
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      851/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      19096/sshd
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      940/postgres
tcp        0      0 127.0.0.1:5433          0.0.0.0:*               LISTEN      939/postgres
tcp        0    464 79.137.81.193:22        29.72.22.156:52036      ESTABLISHED 20310/sshd: root@pt
tcp        0    136 79.137.81.193:22        29.72.22.156:53406      ESTABLISHED 27828/sshd: root@no
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      27741/java
tcp6       0      0 :::5355                 :::*                    LISTEN      23950/systemd-resol
tcp6       0      0 :::80                   :::*                    LISTEN      27741/java
tcp6       0      0 :::22                   :::*                    LISTEN      19096/sshd
tcp6       0      0 :::5432                 :::*                    LISTEN      940/postgres
tcp6       0      0 :::443                  :::*                    LISTEN      27741/java
udp        0      0 0.0.0.0:5355            0.0.0.0:*                           23950/systemd-resol
udp        0      0 127.0.0.1:54514         127.0.0.1:54514         ESTABLISHED 939/postgres
udp        0      0 127.0.0.53:53           0.0.0.0:*                           23950/systemd-resol
udp        0      0 192.168.122.1:53        0.0.0.0:*                           1151/dnsmasq
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1151/dnsmasq
udp        0      0 0.0.0.0:68              0.0.0.0:*                           740/dhclient
udp        0      0 127.0.0.1:58536         127.0.0.1:58536         ESTABLISHED 940/postgres
udp6       0      0 :::5355                 :::*                                23950/systemd-resol

EDIT2: 我将其更改为 tcp 但它仍然没有响应 到 http:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      28573/java

端口 80 像以前一样关闭。你知道我现在可以用它做什么吗?对于此事的任何提示,我将不胜感激。

编辑:如果我有端口为 :8080 和 :443 的连接器,现在它可以工作了,:80 仍然不起作用,尽管它已在防火墙中启用并且我正在 运行ning Tomcat 作为 root,为什么我不能 运行 它在 :80 上呢? Tomcat 在端口 :80 上侦听并且连接总是被拒绝

编辑:

我现在的 server.xml:

<Service name="Catalina">
    <Connector port="80" redirectPort="443" protocol="HTTP/1.1" connectionTimeout="20000" address="0.0.0.0"/>
    <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" KeystoreFile="/opt/tomcat/certificate/nombritech.pl.keystore" keystorePass="pass" />
    <Engine name="Catalina" defaultHost="localhost">
        <Realm className="org.apache.catalina.realm.LockOutRealm">
            <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
        </Realm>
        <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true"></Host>
    </Engine>
</Service>

我重新安装了我的 Ubuntu 服务器,现在它可以正常工作了。我不知道这个问题的确切原因,但它一定是防火墙或其他网络相关问题,因为 Tomcat 配置与以前相同。

感谢您对此事的帮助,我很高兴它开始起作用 :)。我希望我知道为什么它没有工作。