当前位置:网站首页>curl (7) Failed connect to localhost8080; Connection refused
curl (7) Failed connect to localhost8080; Connection refused
2022-07-28 22:17:00 【m0_67403013】
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 就能访问成功了
/
边栏推荐
- 【MySQL 8】Generated Invisible Primary Keys(GIPK)
- [TA frost wolf \u may - "hundred people plan"] Figure 3.6 texture compression - inclusion slimming
- [data mining engineer - written examination] Dahua shares in 2022
- Worthington丨Worthington胰蛋白酶抑制剂说明书
- GhostNets on Heterogeneous Devices via Cheap Operations
- Leetcode61. 旋转链表
- PIP image download
- Jincang database kingbasees client programming interface guide ODBC (2. Overview)
- Leetcode59. 螺旋矩阵 II
- Briefly introduce the working principle and characteristics of block cipher encryption block link mode (cryptography shift cipher encryption and decryption)
猜你喜欢

实时数仓:美团基于Flink的实时数仓建设实施

PowerCL 批量创建及管理虚拟交换机

Interpretation of ISO 13400 (doip) standard

ISO 13400(DoIP)标准解读

PowerCLi VMware vCenter 通过自建的PXE Server一键批量部署常规New-VM

Powercli batch add esxi to vCenter

The failure rate is as high as 80%. How to correctly complete the strategic planning of digital transformation?

Leetcode63. 不同路径 II

EN 1873屋面用装配附件.塑料单个屋面灯—CE认证

考过HCIP入职心仪公司,分享华为认证学习经历及心得
随机推荐
Websocket heartbeat mechanism (keep alive mechanism)
Where is the DP interface of desktop computer (what if the host has no DP interface)
VirtualLab基础实验教程-8.傅里叶变换(1)
Use pytoch to quickly train the network model
YOLOV5学习笔记(一)——原理概述
hutool官网(hutool好用吗)
Kingbasees client programming interface guide ODBC (4. Create data source)
多传感器融合定位(三)——惯性技术
Eight performance analysis indicators of effective supply chain management (Part 1)
SAP oracle 复制新实例后数据库远程连接报错 ora-01031
Powercli VMware vCenter deploys conventional new VMS in batch through self built PXE server with one click
Worthington核糖核酸测定详细攻略
VMware VCSA 7.0 Install
@Transactional 注解使用详解
尿酸酶丨Worthington猪肝尿酸酶的特征:
PHP poster QR code synthesis
Review of categories 1-4
After SAP Oracle replicates a new instance, the remote connection of the database reports an error ora-01031
Classification and determination method of Worthington stemxyme
RHCE first day