gpt4 book ai didi

Tomcat 拒绝在端口 8080 上工作

转载 作者:行者123 更新时间:2023-11-28 21:49:17 26 4
gpt4 key购买 nike

如果之前有人问过这个问题,我很抱歉。

我有一个 Amazon 实例 (Ubuntu Server 12.04.1 LTS) 并安装了 Tomcat 版本 (Apache Tomcat/6.0.36)。它在端口 80 上按预期工作,但在端口 8080 上不工作。(不工作意味着“无法连接到 Web 应用程序管理器”)。

  • 我的安全组配置为 http* 打开了端口 8080
22 (SSH)    0.0.0.0/0   Delete80 (HTTP)   0.0.0.0/0   Delete8080 (HTTP*)    0.0.0.0/0   Delete
  • I have both jdk and jre installed, even I do not know why I need jdkif tomcat running on port 8080.
  • I have configured tomcat to bind on IPV4 address by having
<Connector port="8080" protocol="HTTP/1.1"                connectionTimeout="20000"                redirectPort="8443" address="0.0.0.0"/>

at server.xmland adding

JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"echo $JAVA_OPTS

to setenv.sh

Runnung netstat -ln gives me

Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State      tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN     tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN     tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN     tcp6       0      0 :::22                   :::*                    LISTEN     udp        0      0 0.0.0.0:68              0.0.0.0:*                          Active UNIX domain sockets (only servers)Proto RefCnt Flags       Type       State         I-Node   Pathunix  2      [ ACC ]     STREAM     LISTENING     5886     @/com/ubuntu/upstartunix  2      [ ACC ]     STREAM     LISTENING     7285     /var/run/dbus/system_bus_socketunix  2      [ ACC ]     SEQPACKET  LISTENING     6077     /run/udev/controlunix  2      [ ACC ]     STREAM     LISTENING     7397     /var/run/acpid.socket

Running wget http://localhost:8080 gives me

--2013-04-11 11:20:40--  http://localhost:8080/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7446 (7.3K) [text/html]
Saving to: `index.html'

100%[=====================================================================================================================================================================>] 7,446 --.-K/s in 0s

2013-04-11 11:20:40 (294 MB/s) - `index.html' saved [7446/7446]

那么,我错过了什么吗?

谢谢!!

最佳答案

登录 AWS 控制台并导航至安全组。

  1. 删除 HTTP (80)(如果有)。
  2. 选择自定义 TCP 规则并输入端口“8080”
  3. 点击应用规则。

添加 DNS 名称:8080

现在应该可以了。

关于Tomcat 拒绝在端口 8080 上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15947418/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com