英文:
The site cannot be reached in Apache Tomcat WebServer
问题
I have downloaded eclipse and tomcat. I tried to create a server in Eclipse. I do not have any project at this point.
It starts, Its HTTP port number is 8080.
But when I try to access it from the browser, it does not work. It says the site cannot be reached.
I tried to access through localhost:8080
I ran netstat -na
Output
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
... (more TCP entries)
UDP [::]:63937 *:*
The weird thing is when I start Apache Tomcat from Window+r>Services.msc>Apache Tomcat>start, it starts, and I can access it from localhost:8080
Server Log From Eclipse Console tab
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
... (more log entries)
英文:
I have downloaded eclipse and tomcat. I tried to create a server in Eclipse. I do not have any project at this point.
It starts, It's HTTP port number is 8080.
But when I try to access it from browser. It does not work . It says the site cannot be reached.
I tried to access through
localhost:8080
I ran netstat -na
Output
Active Connections
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 *:*
The weird thing is when start Apache Tomcat from Window+r>Services.msc>Apache Tomcat>start. It starts.and I can access it from localhost:8080
Server Log From Eclipse Console tab
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
答案1
得分: 1
请检查服务器的控制台输出,以获取关于在尝试启动时出现何问题的线索:
这可能会显示出是否存在配置或权限错误等问题。
英文:
Please check the console output from the server to get a clue of what goes wrong when you try to start it:
It may reveal whether you have a configuration or permissions error etc.
答案2
得分: 1
我正在使用
Eclipse 版本:2020-03(4.15.0)
Apache Tomcat 版本:8.5
启动 Eclipse;
创建一个服务器;
按照以下步骤进行:
Eclipse > 工具栏 > 窗口 > 显示视图 > 服务器
然后在服务器视图中,右键单击并添加新服务器。将显示一个弹出窗口,其中包含许多服务器供应商。在 Apache 下选择 Tomcat v7.0(根据您下载的服务器版本而定)。在运行时配置中,将其指向您下载的 Tomcat 文件夹。
单击服务器设置
现在
启动服务器
右键单击新创建的服务器
选择启动
尝试在您喜欢的浏览器中访问
localhost:8080
尽管我不知道为什么这能起作用。我在 YouTube 上看到了这个解决方案。我尝试了一下,结果有效。我在这里发布出来。因此,如果有人遇到相同的问题,这将对他们有帮助。我希望如此。
如果有人能够提供比我更好的解释,请随意编辑我的答案。
英文:
I was using
Eclipse Version: 2020-03 (4.15.0)
Apache Tomcat version: 8.5
start Eclipse>
create a server
Do as this:
Eclipse >toolbar>Windows -> Show View -> Servers
Then in the Servers view, right-click and add new. It will show a pop up containing many server vendors. Under Apache select Tomcat v7.0 (Depending upon your downloaded server version). And in the run time configuration point it to the Tomcat folder you have downloaded.
>Click on server settings
Now
>start server
Right click on newly created server
select start
Try to access
localhost:8080
on your favourite browser.
Although, I have no idea why this worked. I saw this solution in a youtube. I tried it. And It worked. I posted it here.So if someone faces the same problem. It will help them. I hope.
If anyone can provide some better explanation than me. feel free to edit my answer.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论