当前位置:网站首页>curl (7) Failed connect to localhost8080; Connection refused
curl (7) Failed connect to localhost8080; Connection refused
2022-08-04 05:35:00 【m0_67401835】
curl: (7) Failed connect to localhost:8080; Connection refused
如果你也是curl 百度是正常的,curl (自己IP)正常,但是 一 curl http://localhost:8080 就是给你报错,那以下方法你可以尝试下!
我之前去搜索过很多种方法,说nignx 的问题,或则是端口的问题,我跟着尝试了很久都没有效果。后面跟着一个博主说可以去看下日志,我就打开日志看了下,确实发现问题
在tomcat文件夹里面有个logs文件

找到上面这个图的文件名,然后使用文本编辑打开
这里告诉我,其实安装的是/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java,其实并没有所谓的/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java目录,而是/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/
所以我们现在先去查下jdk的路径

然后用 vi /etc/profile 去修改jdk的路径配置
将之前的 JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java/bin/java
改成现在的 JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre

再更新下文件
source /etc/profile
重启tomcat的,再curl 就能访问成功了
/
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- CMDB 腾讯云部分实现
- Computer software: recommend a disk space analysis tool - WizTree
- Detailed explanation of DenseNet and Keras reproduction code
- A semi-supervised Laplace skyhawk optimization depth nuclear extreme learning machine for classification
- HbuilderX 启动微信小程序 无法打开项目
- YOLOv3详解:从零开始搭建YOLOv3网络
- JVM调优实践
- 网络端口大全
- 如何用matlab做高精度计算?【第三辑】(完)
- 升级到 MediaPlayer 11 时跳过验证副本的方法
猜你喜欢

Network skills: teach you to install batteries on the router, you can still surf the Internet when the power is cut off!

QT QOpenGLWidget 全屏导致其他控件显示问题

IoU, GIoU, DIoU and CIoU in target detection

电脑知识:台式电脑应该选择品牌和组装,值得收藏

解决腾讯云DescribeInstances api查询20条记录以上的问题

硬件知识:RTMP和RTSP传统流媒体协议介绍

用手机也能轻松玩转MATLAB编程

Database: Organize Four Practical SQL Server Scripting Functions

Interpretation of EfficientNet: Composite scaling method of neural network (based on tf-Kersa reproduction code)

RuntimeError: You called this URL via POST, but the URL doesn‘t end in a slash and you have APPEND_S
随机推荐
mysql月份比較是否相等
第九篇 ApplicationContext初始化
this关键字,构造函数
Hardware Knowledge: Introduction to RTMP and RTSP Traditional Streaming Protocols
Prematurely reached end of stream
Uos统信系统 Postfix-smtps & Dovecot-imaps
Computer knowledge: desktop computers should choose the brand and assembly, worthy of collection
av_read_frame 阻塞,基于回调的解决办法
更改mysql数据库默认的字符集(mysql 存储 emoji表情)
IE8 打开速度慢的解决办法
零分贝超静音无线鼠标!数量有限!!先到先得!!!【元旦专享】
ssm pom文件依赖 web.xml配置
格拉姆角场GAF将时序数据转换为图像并应用于故障诊断
解决腾讯云DescribeInstances api查询20条记录以上的问题
matlab让我的旧手机起死回生
如何画好业务架构图。
RHCE之路----全
水平垂直居中的12种方法,任意插入节点的方法,事件的绑定的三种方法和解绑的方法,事件对象,盒子模型
电脑软件:推荐一款磁盘空间分析工具——WizTree
SENet detailed explanation and Keras reproduction code