当前位置:网站首页>curl (7) Failed connect to localhost8080; Connection refused
curl (7) Failed connect to localhost8080; Connection refused
2022-07-30 05:14:00 【m0_67391518】
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 就能访问成功了
/
边栏推荐
- Intermediate - interview questions
- VisualStudio2022 local debugging entry is particularly slow problem solving
- 力扣05-替换空格——字符串问题
- DLL说明(1)
- VisualStudio2022本地调试进入特别慢问题解决
- 翻译 | 解读首部 Kubernetes 纪录片
- 22. Why do you need a message queue?What are the advantages of using the message queue?
- NFT 产品设计路线图
- 无代码开发平台重新申请入门教程
- GO language study notes one
猜你喜欢
随机推荐
力扣20-有效的括号——栈实现
mysql无法远程连接 Can‘t connect to MySQL server on ‘xxx.xxx.xxx.xxx‘ (10060 “Unknown error“)
Naive Bayes Classification
容器化 | 在 KubeSphere 中部署 MySQL 集群
Golang——从入门到放弃
POJ1321 chessboard problem (detailed explanation)
Protobuf compound data types, speaking, reading and writing
光明区关于促进科技创新的若干措施(征求意见稿)
Usage when saving pointers in std::vector
[Verilog] HDLBits Problem Solution - Circuits/Combinational Logic
Predictive maintenance scheduling of multiple power equipment based on data-driven fault prediction
go language study notes 2
Kyligence 再获 CRN, insideBIGDATA 两大国际奖项认可
Dynamically bind href url
C语言实现安全性极高的游戏存档并读档
Intermediate - interview questions
Dynamic Programming Problems (End)
Catch That Cow (detailed)
How can I make (a == 1 && a == 2 && a == 3) to be true?
Hexagon_V65_Programmers_Reference_Manual (11)









