当前位置:网站首页>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 就能访问成功了
/
边栏推荐
猜你喜欢
随机推荐
关于组织开展2022年广东省技术先进型服务企业认定工作的通知
The Double Pointer Problem (Part 1)
1315_Use the LOOPBACK simulation mode to test whether the pyserial installation is successful
开源之夏 2022 重磅来袭!欢迎报名 RadonDB 社区项目!
golang八股文整理(持续搬运)
std::vector中保存指针时用法
webService interface
坪山区关于开展2022年度科技创新专项资金申报工作的通知
给小白的 PG 容器化部署教程(下)
NFT 产品设计路线图
pycharm上的tensorflow环境搭载
3. Dependency configuration management
Simulation problem (middle)
WPF introduces ttf icon file usage record
2022鹏城杯web
Some understanding of YOLOv7
Detailed explanation of REUSE_ALV_GRID_DISPLAY
Dynamic Programming Problems (End)
容器化 | 在 K8s 上部署 RadonDB MySQL Operator 和集群
gnss rtcm rtklib Ntrip...








