通过键入 localhost:8080 错误:ERR_CONNECTION_REFUSED 无法加载 tomcat10 主页 [英] tomcat10 home page can not load by typing localhost:8080 error: ERR_CONNECTION_REFUSED

查看:135
本文介绍了通过键入 localhost:8080 错误:ERR_CONNECTION_REFUSED 无法加载 tomcat10 主页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的 Pi 3B+ Debian 完整桌面 Linux 32 位操作系统上安装了 tomcat10

为了使 tomcat10 服务器成功安装在我刚构建的机器上,我遵循以下推荐设置.

<块引用>

pi@Home:~ $ java -versionopenjdk 版本11.0.9.1"2020-11-04OpenJDK 运行时环境(构建 11.0.9.1+1-post-Raspbian-1deb10u2)OpenJDK Server VM(build 11.0.9.1+1-post-Raspbian-1deb10u2,混合模式)

然后从以下位置下载并安装tomcat10:

<块引用>

wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.2/bin/apache-tomcat-10.0.2.tar.gz

在以下两个 XML 文件中将 IP 地址更改为我的本地 IP 地址:

<块引用>

管理器文件:./webapps/manager/META-INF/context.xml 主机管理器文件:./webapps/host-manager/META-INF/context.xml

 

安装完成后,我设法设置环境并启动服务器

<块引用>

root@Home:/usr/local/tomcat10# ./bin/startup.sh

输出:

<块引用>

使用 CATALINA_BASE:/usr/local/tomcat10使用 CATALINA_HOME:/usr/local/tomcat10使用 CATALINA_TMPDIR:/usr/local/tomcat10/temp>使用 JRE_HOME:/usr/lib/jvm/java-11-oracle使用类路径:/usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar使用 CATALINA_OPTS:
Tomcat 启动了.

但是当我输入 localhost:8080 时,我收到一条错误消息:

<块引用>

无法访问此站点本地主机拒绝连接.试试:

<块引用>

检查连接检查代理和防火墙ERR_CONNECTION_REFUSED

由于网络上的一些文章建议将 server.xml 中的端口 8080 更改为端口 80,即使尝试此选项也不能解决我的问题,因为我通过键入 localhost:80 在端口 80 上运行了 apache webserver,它会加载apache 网络服务器的索引页

由于它是全新安装,我的系统中甚至没有在路由器防火墙上安装任何防火墙,因此我启用了 TCP/UDP 端口 80 和 8080

谁能建议我应该怎么做才能加载 tomcat 索引页面?

解决方案

因为我几天前已经发布了这个问题,但我无法得到答案,所以我决定尝试一些自己的方法,看看我是否可以解决问题.在我的案例解决方案中,我发布解决了上述问题,并且我能够从我的浏览器窗口连接到 localhost:8080.我必须承认我通过 flook 找到了这个解决方案我仍然不知道它起作用的背后的逻辑,但它正在起作用.

<块引用>

root@Home:/usr/local/tomcat10# ./bin/startup.sh

输出:

<块引用>

使用 CATALINA_BASE:/usr/local/tomcat10 使用 CATALINA_HOME:/usr/local/tomcat10 使用 CATALINA_TMPDIR:/usr/local/tomcat10/temp>使用JRE_HOME:/usr/lib/jvm/java-11-oracle 使用 CLASSPATH:/usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar使用 CATALINA_OPTS:Tomcat 启动了.

在这个阶段,我知道 tomcat 已成功安装并且服务都已启动并正在运行,因此浏览器可能有问题,这可能会导致连接问题.

所以我采取了以下步骤:

第 1 步

我点击了 Chrome 浏览器窗口右上角的三个点(设置),然后点击了更多工具,然后点击了清除浏览数据.

在清除浏览、数据窗口中单击高级选项卡并从下拉列表中选择所有时间

勾选除密码和其他登录数据和自动填充选项外的所有选项

选择后点击清除数据按钮

打开新的浏览器窗口并输入 localhost:8080

无法连接到服务器消息

第 2 步

现在打开我的帐户设置页面,从这里浏览到我的活动并清除所有以前记录的活动日志并关闭所有活动活动记录滑动开关

网络和应用活动位置记录YouTube 历史记录广告个性化

打开 Web 浏览器并输入 localhost:8080(回车)仍然收到相同的错误消息

第 3 步转到添加广告设置,我过去关闭了广告个性化设置,因为我不希望 Google 收集我的浏览数据.在您的情况下,它可能仍处于打开状态,因此我为浏览器重新打开了它.

现在键入 localhost:8080 令人惊讶的是在我的浏览器窗口中打开了 tomcat10 索引页为了测试它是否是停止 tomcat10 索引页加载到浏览器窗口中的广告设置我再次关闭广告个性化选项卡并键入 localhost:8080 并按 Enter甚至广告个性化选项卡也已关闭,但这次 tomcat10 索引页面再次加载到浏览器窗口.

因此,我不能 100% 确定是广告个性化状态不允许在浏览器窗口中加载 tomcat10 索引页面还是我关闭的其他先前选项之一

为了进一步测试,我关闭了所有浏览器,然后在新的浏览器窗口中输入 localhost:8080 并且索引页仍然成功加载.

这个解决方案对我有用,希望它也能帮助其他读者

I had install tomcat10 on my Pi 3B+ Debian full desktop Linux 32bit OS

To make the tomcat10 server successfully instal on my freshly build machine I follow the following recommended settings.

pi@Home:~ $ java -version openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment (build 11.0.9.1+1-post-Raspbian-1deb10u2) OpenJDK Server VM (build 11.0.9.1+1-post-Raspbian-1deb10u2, mixed mode)

Then download and install tomcat10 from:

wget https://downloads.apache.org/tomcat/tomcat-10/v10.0.2/bin/apache-tomcat-10.0.2.tar.gz

Change the IP address to my local IP address in both following XML files:

Manager File: ./webapps/manager/META-INF/context.xml Host Manager File: ./webapps/host-manager/META-INF/context.xml

 <Context antiResourceLocking="false" privileged="true" >
 <CookieProcessor className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"
                  sameSiteCookies="strict" />
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1|192.168.0.16" />
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>

After installation complete, I manage to set the environment and start the server

root@Home:/usr/local/tomcat10# ./bin/startup.sh

Output:

Using CATALINA_BASE: /usr/local/tomcat10 Using CATALINA_HOME: /usr/local/tomcat10 Using CATALINA_TMPDIR: /usr/local/tomcat10/temp> Using JRE_HOME: /usr/lib/jvm/java-11-oracle Using CLASSPATH: /usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar Using CATALINA_OPTS:
Tomcat started.

but when I type localhost:8080 I get an error message:

This site can’t be reached localhost refused to connect. Try:

Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED

As some of the articles on the web suggest to change port 8080 to port 80 in server.xml even trying this option doesn't solve my problem because I have apache webserver running on port 80 by typing localhost:80 it loads the index page for apache webserver

As it is a fresh install and I do not have any firewall installed in my system even on my Router firewall I have enabled TCP/UDP ports 80 and 8080

can anyone please suggest what should I do to load the tomcat index page?

解决方案

As I have posted this question couple of days ago but I was unable to get an answer so I decided to try a few methods of my own to see if I can resolve the problem. In my case solution, I am posting solved the above issue and I am able to connect to localhost:8080 from my browser window. I have to confess I found this solution by flook I still don't know the logic behind what made it work but it is working.

root@Home:/usr/local/tomcat10# ./bin/startup.sh

Output:

Using CATALINA_BASE: /usr/local/tomcat10 Using CATALINA_HOME: /usr/local/tomcat10 Using CATALINA_TMPDIR: /usr/local/tomcat10/temp> Using JRE_HOME: /usr/lib/jvm/java-11-oracle Using CLASSPATH: /usr/local/tomcat10/bin/bootstrap.jar:/usr/local/tomcat10/bin/tomcat->juli.jar Using CATALINA_OPTS: Tomcat started.

at this stage, I know tomcat is installed successfully and services are all up and running therefore there maybe is something wrong with the browser which may be causing a connectivity issue.

So I took the following steps:

Step No:1

I have click on three dots on the top right-hand side of the Chrome browser window (setting) then I click on more tools then click on clear browsing data.

From the Clear browsing, data window clicked the advance tab and select all times from the drop-down list

Tick all options except Password and other sign-in data and Autofill option

After your selection click the Clear data button

Open new browser window and type localhost:8080

Got unable to connect to the server message

Step NO:2

Now open the My account setting page and from here browse to My activity and clear all previously recorded activities log and turn off all active activity recording sliding switches

Web & App Activity Location History YouTube History Ad personalisation

Open the web browser and typed localhost:8080 (Enter) still got the same error message

Step NO:3 Go to add the Ad settings, I turned the Ad personalisation setting OFF in past because I didn't want Google to collect my browsing data In your case it might still be ON so I turned it back on for my browser.

now type localhost:8080 surprisingly tomcat10 index page open in my browser window To test if it was Ad setting which was stoping tomcat10 index page to load in browser window I turned Ad personalisation tab OFF again and type localhost:8080 and press Enter Even the Ad personalisation tab is OFF but this time tomcat10 index page is loaded to the browser window again.

Therefore I am not 100% sure if it was Ad personalisation state which was not allowing the tomcat10 index page to load in the browser window or one of the other previous options which I turned off

To test further I have close all my browsers and then type localhost:8080 in a new browser window and the index page still loading successfully.

This solution is working for me hope it will help other readers too

这篇关于通过键入 localhost:8080 错误:ERR_CONNECTION_REFUSED 无法加载 tomcat10 主页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆