Freshly provisioned and deployed environment not accepting connections

I’ve recently provisioned a new server and deployed essentially a boilerplate bedrock / sage10 setup to test things. At first the server responded with a 500 but I had yet to deploy. After the deploy it says it is refusing connections. I can ssh fine into the machine and see that the deploy was successful as the code is located in /srv/www/project.com/current/. I’m not sure what the issue is.

My only idea is that it is an issue with the wordpress_sites → local_path value from the environments group_vars wordpress_sites.yml.

The docs WordPress Sites | Trellis Docs | Roots say

  • local_path - path targeting Bedrock-based site directory (required)

This is set by default to ../site but I don’t see what that path could be referencing. I tried changing it to /srv/www/project.com/current/ and reprovisioning but this does not change anything.

I also checked the server firewall and connections are being allowed on both http/80 and https/443. I also rebooted the machine, but no change.

One note is that this is a custom environment. Meaning it is not staging.project.com but sage-10.project.com, but I don’t see that making a difference.

Thank you in advance for any tips.

How did you provision the server and how did you deploy to it? Was it the standard Trellis commands or did you use another method?

:thinking: It could also be caused by fail2ban (had a similar issue, with SSH connections). Have you attempted connections with a different IP address?

Standard Trellis commands. Both succeeded according to the logs.

Provisioning and deploying to an AWS Lightsail instance.

How do you mean? I’m trying to connect over http to the domain name. This is also how I’m connecting via SSH which works.

Often there is a cloud/hardware firewall in front of the virtual machine which also has to be configured to allow HTTP/HTTPS. SSH is often open by default, so it would work without explicit firewall configuration, but HTTP/HTTPS does not.

2 Likes

The firewall setting are the same as another Lightsail instance that responds without issue. Also the staging site.

I will destroy the Lightsail instance and recreate it tomorrow to see if perhaps I missed something.

1 Like

Some obvious tests:

  • netstat -taupen | grep nginx Is nginx actually listening on port 80 and/or 443?
  • service nginx status
  • wget http://thedomain.tld on the web server itself, does that work? Note that just using localhost normally does not work by nginx Trellis default configuration.
1 Like

Honestly you might just try destroying and reprovisioning the server.

For what it’s worth (nothing) I had the exact same issue the first time I tried deploying to an ARM AWS server for the first time. Second time it worked flawlessly though.

My best guess is that this is a super rare bug and that like me, you happened to stumble onto it.