[Solved] cURL error 7: Failed to connect to domain.com port 443: Connection refused Vestacp

cURL error 7 WordPress problem: Vestacp is a lightweight open-source cpanel alternative. cURL error 7 problem is not a big deal in vestacp.

What is the Problem?

cURL error 7: Failed to connect to domain.com port 443: Connection refused

What is the solution?

The curl 7 error problem is very annoying. If you have VPS with vestacp installed, then this is a common problem.

To solve Curl 7 error in wordpress, you need to edit the hosts file in your VPS using SSH prompt. In the hosts file you need to add your ip address and domain name manually.

To solve cURL 7 error in vestacp as well as any vps follow the instructions.

Step 1: Log in to your server using SSH

First try

curl yourdoman.com

It will returet with the curl 7 error failed to connect to yourdomain.com using port 80.

Next try

curl https://yourdomain.com

The problem should be same as previous one, only the difference is port 443.

Now try

curl -vv yourdoman.com

Here the problem is same. can not rebuilt curl bla bla bla…

Enough, now we should try to solve this.

Step 2: Edit the following file (hosts file) using a nano or vim editor.

nano /etc/hosts

It should be look like this

127.0.0.1 localhost
127.0.1.1 yourdomain.com
The following lines are desirable for IPv6 capable hosts
:1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Enter the following line after the second line

xx.xx.xx.xx yourdomain.com

Note: Replace xx.xx.xx.xx by your server ip address; and yourdomain.com by your fqdn or host domain.

So that the final code looks like this

127.0.0.1 localhost
127.0.1.1 yourdomain.com
xx.xx.xx.xx yourdomain.com
The following lines are desirable for IPv6 capable hosts
:1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
curl 7 error wordpress vestacp

Step 3: Restart your server

Sudo service nginx restart
sudo service vesta restart
sudo reboot

That’s it. Hope the curl 7 problem should be resolved.

Other Articles you may like
[Solve] VestaCP (HY000/1045): Access denied for user ‘PHPMyAdmin Ubuntu 18.04
WordPress 5.3 Image Upload Failed Problem – Solution
Fix File Permission for WordPress in VestaCP

7 thoughts on “[Solved] cURL error 7: Failed to connect to domain.com port 443: Connection refused Vestacp”

Leave a Comment