【问题标题】:How to run tomcat7 web app through https over port 8443?如何通过端口 8443 上的 https 运行 tomcat7 Web 应用程序?
【发布时间】:2015-06-16 13:36:31
【问题描述】:

我有一个 vaadin 7 应用程序在 EC2 服务器上的 tomcat 7 上运行。该应用程序通过端口 8080 运行,因此我使用以下命令将我的域从 80 重定向到 8080:

/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

现在,我需要使用应该在端口 8443 或 443 上运行的 SSL 证书,但是使用 sudo netstat -nlp 检查我的端口,我得到了:

    Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      2332/sshd           
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      2371/sendmail       
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      2987/mysqld         
tcp        0      0 :::8080                     :::*                        LISTEN      3204/java           
tcp        0      0 :::80                       :::*                        LISTEN      3151/httpd          
tcp        0      0 :::22                       :::*                        LISTEN      2332/sshd           
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      3204/java           
tcp        0      0 :::8009                     :::*                        LISTEN      3204/java           
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               2063/dhclient       
udp        0      0 172.30.0.27:123             0.0.0.0:*                               2356/ntpd           
udp        0      0 127.0.0.1:123               0.0.0.0:*                               2356/ntpd           
udp        0      0 0.0.0.0:123                 0.0.0.0:*                               2356/ntpd           
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     1742   2987/mysqld         /var/lib/mysql/mysql.sock
unix  2      [ ACC ]     STREAM     LISTENING     10316  2151/dbus-daemon    /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     9565   1/init              @/com/ubuntu/upstart
unix  2      [ ACC ]     SEQPACKET  LISTENING     9820   1578/udevd          @/org/kernel/udev/udevd

所以,据我了解,这些端口甚至都不存在...我如何“激活”它们,然后将它们用于我的 https 连接?

【问题讨论】:

    标签: ssl amazon-ec2 tomcat7 port vaadin


    【解决方案1】:

    您应该在您的 tomcat 中配置您的证书,如 here 所示。 然后您应该在 EC2 控制台中打开这些端口,如 here 所示。

    【讨论】:

    • 谢谢!!已经这样做了.....我的 server.xml 包含:<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> 和 <Connector port="8443" protocol="HTTP/1.1" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" SSLEnabled="true" clientAuth="false" sslProtocol="TLS" keyAlias="server" keystoreFile="/home/ec2-user/www_domain_com.jks" keystorePass="password" />,正如您发送的第一个链接所说,有什么想法吗?
    • 您检查过 catalina.out 是否有错误?您的 HTTPS 本地请求有效吗?您使用的是什么 Linux 发行版?你在使用防火墙吗? (如果是 Ubuntu/Debian)你检查过你的 Iptables 了吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-07
    • 1970-01-01
    • 1970-01-01
    • 2018-02-20
    • 1970-01-01
    • 2012-04-19
    • 2018-11-08
    相关资源
    最近更新 更多