The site cannot be reached in Apache Tomcat WebServer
我已经下载了eclipse和tomcat。我试图在 Eclipse 中创建一个服务器。我目前没有任何项目。
启动,它的HTTP端口号是8080。
但是当我尝试从浏览器访问它时。这是行不通的 。它说无法访问该站点。
我试图通过
本地主机:8080
我运行了 netstat -na
输出
活动连接
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | Proto Local Address Foreign Address State TCP 0.0.0.0:135 0.0.0.0:0 LISTENING TCP 0.0.0.0:445 0.0.0.0:0 LISTENING TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING TCP 0.0.0.0:5040 0.0.0.0:0 LISTENING TCP 0.0.0.0:7680 0.0.0.0:0 LISTENING TCP 0.0.0.0:33060 0.0.0.0:0 LISTENING TCP 0.0.0.0:49664 0.0.0.0:0 LISTENING TCP 0.0.0.0:49665 0.0.0.0:0 LISTENING TCP 0.0.0.0:49666 0.0.0.0:0 LISTENING TCP 0.0.0.0:49667 0.0.0.0:0 LISTENING TCP 0.0.0.0:49668 0.0.0.0:0 LISTENING TCP 0.0.0.0:49669 0.0.0.0:0 LISTENING TCP 0.0.0.0:63937 0.0.0.0:0 LISTENING TCP 127.0.0.1:1001 0.0.0.0:0 LISTENING TCP 127.0.0.1:8254 0.0.0.0:0 LISTENING TCP 127.0.0.1:8254 127.0.0.1:56628 ESTABLISHED TCP 127.0.0.1:8254 127.0.0.1:56695 ESTABLISHED TCP 127.0.0.1:19612 0.0.0.0:0 LISTENING TCP 127.0.0.1:19612 127.0.0.1:55755 ESTABLISHED TCP 127.0.0.1:49677 127.0.0.1:49678 ESTABLISHED TCP 127.0.0.1:49678 127.0.0.1:49677 ESTABLISHED TCP 127.0.0.1:49681 0.0.0.0:0 LISTENING TCP 127.0.0.1:49681 127.0.0.1:57503 ESTABLISHED TCP 127.0.0.1:55744 0.0.0.0:0 LISTENING TCP 127.0.0.1:55755 127.0.0.1:19612 ESTABLISHED TCP 127.0.0.1:55756 0.0.0.0:0 LISTENING TCP 127.0.0.1:56628 127.0.0.1:8254 ESTABLISHED TCP 127.0.0.1:56695 127.0.0.1:8254 ESTABLISHED TCP 127.0.0.1:57503 127.0.0.1:49681 ESTABLISHED TCP 192.168.0.4:139 0.0.0.0:0 LISTENING TCP 192.168.0.4:49228 34.194.96.239:443 TIME_WAIT TCP 192.168.0.4:49249 216.239.32.116:443 TIME_WAIT TCP 192.168.0.4:50939 172.217.167.195:443 TIME_WAIT TCP 192.168.0.4:50962 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50965 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50966 10.254.254.112:55501 TIME_WAIT TCP 192.168.0.4:50969 10.254.254.116:55501 TIME_WAIT TCP 192.168.0.4:50970 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50972 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50973 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:50974 10.254.254.129:55501 TIME_WAIT TCP 192.168.0.4:50975 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50979 10.254.254.128:55501 TIME_WAIT TCP 192.168.0.4:50981 10.254.254.112:55501 TIME_WAIT TCP 192.168.0.4:50982 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:50983 10.254.254.114:55501 TIME_WAIT TCP 192.168.0.4:50989 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50993 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50997 10.254.254.129:55501 TIME_WAIT TCP 192.168.0.4:50998 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:50999 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51002 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51010 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51016 10.254.254.115:55501 TIME_WAIT TCP 192.168.0.4:51017 10.254.254.116:55501 TIME_WAIT TCP 192.168.0.4:51019 10.254.254.117:55501 TIME_WAIT TCP 192.168.0.4:51020 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51023 10.254.254.119:55501 TIME_WAIT TCP 192.168.0.4:51027 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51029 10.254.254.127:55501 TIME_WAIT TCP 192.168.0.4:51031 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51032 10.254.254.125:55501 TIME_WAIT TCP 192.168.0.4:51033 4.16.74.104:443 TIME_WAIT TCP 192.168.0.4:51035 10.254.254.117:55501 TIME_WAIT TCP 192.168.0.4:51040 10.254.254.122:55501 TIME_WAIT TCP 192.168.0.4:51042 10.254.254.115:55501 TIME_WAIT TCP 192.168.0.4:51047 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51050 10.254.254.128:55501 TIME_WAIT TCP 192.168.0.4:51051 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51052 10.254.254.112:55501 TIME_WAIT TCP 192.168.0.4:51055 10.254.254.114:55501 TIME_WAIT TCP 192.168.0.4:51062 10.254.254.115:55501 TIME_WAIT TCP 192.168.0.4:51064 103.124.96.149:47464 TIME_WAIT TCP 192.168.0.4:51067 10.254.254.121:55501 TIME_WAIT TCP 192.168.0.4:51069 10.254.254.116:55501 TIME_WAIT TCP 192.168.0.4:51070 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:51072 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:51073 10.254.254.116:55501 TIME_WAIT TCP 192.168.0.4:51075 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51076 10.254.254.115:55501 TIME_WAIT TCP 192.168.0.4:51077 10.254.254.126:55501 TIME_WAIT TCP 192.168.0.4:51080 52.206.44.147:443 ESTABLISHED TCP 192.168.0.4:51081 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51086 172.217.166.202:443 ESTABLISHED TCP 192.168.0.4:51087 172.217.31.2:443 ESTABLISHED TCP 192.168.0.4:51088 172.217.31.2:443 ESTABLISHED TCP 192.168.0.4:51089 192.0.73.2:443 ESTABLISHED TCP 192.168.0.4:51091 198.252.206.25:443 ESTABLISHED TCP 192.168.0.4:51092 99.86.47.24:443 ESTABLISHED TCP 192.168.0.4:51093 10.254.254.117:55501 TIME_WAIT TCP 192.168.0.4:51094 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51095 10.254.254.114:55501 TIME_WAIT TCP 192.168.0.4:51097 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51104 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51105 203.86.196.1:34156 TIME_WAIT TCP 192.168.0.4:51108 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51111 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51112 103.124.96.171:47464 TIME_WAIT TCP 192.168.0.4:51117 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51118 10.254.254.117:55501 TIME_WAIT TCP 192.168.0.4:51119 10.254.254.111:55501 TIME_WAIT TCP 192.168.0.4:51122 10.254.254.118:55501 TIME_WAIT TCP 192.168.0.4:51124 10.254.254.116:55501 TIME_WAIT TCP 192.168.0.4:51125 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51127 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51130 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51131 52.114.32.8:443 TIME_WAIT TCP 192.168.0.4:51132 10.254.254.119:55501 TIME_WAIT TCP 192.168.0.4:51133 10.254.254.114:55501 TIME_WAIT TCP 192.168.0.4:51135 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51137 10.254.254.128:55501 TIME_WAIT TCP 192.168.0.4:51138 10.254.254.111:55501 TIME_WAIT TCP 192.168.0.4:51139 10.254.254.117:55501 TIME_WAIT TCP 192.168.0.4:51140 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51141 10.254.254.121:55501 TIME_WAIT TCP 192.168.0.4:51143 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51145 10.254.254.112:55501 TIME_WAIT TCP 192.168.0.4:51147 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51150 103.103.8.170:63414 FIN_WAIT_2 TCP 192.168.0.4:51152 10.254.254.118:55501 TIME_WAIT TCP 192.168.0.4:51154 94.227.161.30:18922 TIME_WAIT TCP 192.168.0.4:51155 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51156 4.16.74.136:443 TIME_WAIT TCP 192.168.0.4:51157 10.254.254.123:55501 SYN_SENT TCP 192.168.0.4:51158 177.17.35.49:6881 SYN_SENT TCP 192.168.0.4:51159 103.214.202.13:8999 SYN_SENT TCP 192.168.0.4:51162 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51163 10.254.254.114:55501 TIME_WAIT TCP 192.168.0.4:51164 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:51165 10.254.254.125:55501 TIME_WAIT TCP 192.168.0.4:51166 103.103.8.167:63414 ESTABLISHED TCP 192.168.0.4:51167 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51168 24.163.66.84:6881 SYN_SENT TCP 192.168.0.4:51169 10.254.254.123:55501 SYN_SENT TCP 192.168.0.4:51170 41.242.78.19:32604 SYN_SENT TCP 192.168.0.4:51171 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51172 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51175 10.254.254.115:55501 TIME_WAIT TCP 192.168.0.4:51176 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51178 4.16.72.100:443 TIME_WAIT TCP 192.168.0.4:51179 10.254.254.113:55501 TIME_WAIT TCP 192.168.0.4:51180 10.254.254.122:55501 TIME_WAIT TCP 192.168.0.4:51181 10.254.254.112:55501 TIME_WAIT TCP 192.168.0.4:51182 10.254.254.128:55501 TIME_WAIT TCP 192.168.0.4:51183 4.16.72.100:443 ESTABLISHED TCP 192.168.0.4:51185 10.254.254.119:55501 TIME_WAIT TCP 192.168.0.4:63381 74.125.24.188:5228 ESTABLISHED TCP 192.168.0.4:63764 40.119.211.203:443 ESTABLISHED TCP 192.168.0.4:63937 39.38.55.225:53303 TIME_WAIT TCP 192.168.0.4:63937 39.38.55.225:53339 TIME_WAIT TCP 192.168.0.4:63937 182.48.66.41:49604 TIME_WAIT TCP 192.168.0.4:63937 182.48.66.41:50430 TIME_WAIT TCP 192.168.0.4:63937 182.48.66.41:65163 ESTABLISHED TCP 192.168.0.4:63937 188.146.41.118:53142 TIME_WAIT TCP 192.168.0.4:63937 213.118.12.106:56780 ESTABLISHED TCP 192.168.0.4:63937 221.121.133.118:62615 TIME_WAIT TCP 192.168.0.4:64698 172.217.166.14:443 TIME_WAIT TCP 192.168.0.4:64900 151.101.129.69:443 ESTABLISHED TCP 192.168.0.4:64902 151.101.129.69:443 ESTABLISHED TCP 192.168.0.4:64915 99.86.47.2:443 TIME_WAIT TCP 192.168.0.4:65185 172.217.167.35:443 ESTABLISHED TCP [::]:135 [::]:0 LISTENING TCP [::]:445 [::]:0 LISTENING TCP [::]:3306 [::]:0 LISTENING TCP [::]:7680 [::]:0 LISTENING TCP [::]:33060 [::]:0 LISTENING TCP [::]:49664 [::]:0 LISTENING TCP [::]:49665 [::]:0 LISTENING TCP [::]:49666 [::]:0 LISTENING TCP [::]:49667 [::]:0 LISTENING TCP [::]:49668 [::]:0 LISTENING TCP [::]:49669 [::]:0 LISTENING TCP [::]:63937 [::]:0 LISTENING UDP 0.0.0.0:67 *:* UDP 0.0.0.0:500 *:* UDP 0.0.0.0:1900 *:* UDP 0.0.0.0:4500 *:* UDP 0.0.0.0:5050 *:* UDP 0.0.0.0:5353 *:* UDP 0.0.0.0:5353 *:* UDP 0.0.0.0:5353 *:* UDP 0.0.0.0:5355 *:* UDP 0.0.0.0:63937 *:* UDP 127.0.0.1:1900 *:* UDP 127.0.0.1:6771 *:* UDP 127.0.0.1:49664 *:* UDP 127.0.0.1:59439 *:* UDP 127.0.0.1:59880 *:* UDP 192.168.0.4:137 *:* UDP 192.168.0.4:138 *:* UDP 192.168.0.4:1900 *:* UDP 192.168.0.4:6771 *:* UDP 192.168.0.4:59438 *:* UDP 192.168.0.4:59879 *:* UDP [::]:500 *:* UDP [::]:4500 *:* UDP [::]:5353 *:* UDP [::]:5353 *:* UDP [::]:5355 *:* UDP [::]:63937 *:* UDP [::1]:1900 *:* UDP [::1]:59437 *:* UDP [fe80::8a:a9d2:b31d:afe7%5]:1900 *:* UDP [fe80::8a:a9d2:b31d:afe7%5]:59436 *:* |
奇怪的是从 Window r>Services.msc>Apache Tomcat>start 启动 Apache Tomcat。它开始了。我可以从 localhost:8080
访问它
来自 Eclipse 控制台选项卡的服务器日志
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version name: Apache Tomcat/8.5.53 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Mar 11 2020 10:01:39 UTC Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version number: 8.5.53.0 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Windows 10 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 10.0 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: C:\\Program Files\\Java\\jre1.8.0_241 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.8.0_241-b07 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Oracle Corporation Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: C:\\Users\\WAHEGURU\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=C:\\Users\\WAHEGURU\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5 Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dwtp.deploy=C:\\Users\\WAHEGURU\\eclipse-workspace\\.metadata\\.plugins\\org.eclipse.wst.server.core\\tmp0\\wtpwebapps Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.endorsed.dirs=C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5\\endorsed Apr 04, 2020 5:39:41 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dfile.encoding=Cp1252 Apr 04, 2020 5:39:41 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\\Program Files\\Java\\jre1.8.0_241\\bin;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:/Program Files/Java/jre1.8.0_241/bin/server;C:/Program Files/Java/jre1.8.0_241/bin;C:/Program Files/Java/jre1.8.0_241/lib/amd64;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin;C:\\Program Files\\Java\\jdk1.8.0_241\\bin;E:\\softwares\\ffmpeg-20200330-8d019db-win64-static\\bin\\;C:\\Program Files (x86)\\Vim\\vim82;C:\\Program Files\\MySQL\\MySQL Shell 8.0\\bin\\;C:\\Users\\WAHEGURU\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\;C:\\Users\\WAHEGURU\\AppData\\Local\\Programs\\Python\\Python38\\;C:\\Users\\WAHEGURU\\AppData\\Local\\Microsoft\\WindowsApps;E:\\softwares\\eclipse;;.] Apr 04, 2020 5:39:41 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-nio-8080"] Apr 04, 2020 5:39:42 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector INFO: Using a shared selector for servlet write/read Apr 04, 2020 5:39:42 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1025 ms Apr 04, 2020 5:39:42 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service [Catalina] Apr 04, 2020 5:39:42 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/8.5.53 Apr 04, 2020 5:39:42 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-nio-8080"] Apr 04, 2020 5:39:42 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 382 ms |
我正在使用
Eclipse 版本:2020-03 (4.15.0)
Apache Tomcat 版本:8.5
启动 Eclipse>
创建服务器
这样做:
Eclipse >工具栏>Windows -> 显示视图 -> 服务器
然后在"服务器"视图中,右键单击并添加新的。它将显示一个包含许多服务器 vendor的弹出窗口。在 Apache 下选择 Tomcat v7.0(取决于您下载的服务器版本)。在运行时配置中将其指向您下载的 Tomcat 文件夹。
Click on server settings
现在
start server
右键单击新创建的服务器
选择开始
尝试访问
本地主机:8080
在您最喜欢的浏览器上。
虽然,我不知道为什么会这样。我在 youtube 上看到了这个解决方案。我尝试过这个。它奏效了。我把它贴在这里。所以如果有人面临同样的问题。这将帮助他们。我希望。
如果有人能提供比我更好的解释。随时编辑我的答案。
请检查服务器的控制台输出,以了解尝试启动它时出现的问题:
它可能会显示您是否有配置或权限错误等。