Unable to connect to 1 of 3 Apache virtual host

I’m trying to add Nextcloud to my domain. Have had it working before but not like I wanted so, I elected for a fresh install of Apache on Ubuntu 22.04. I have the domain and 2 sub-domains. The domain and 1 of the sub-domains work perfectly. Unfortunately, the subdomain I want to use for Nextcloud is “Unable to connect”. I’ve check, recheck, triple, and quadruple checked the sites-available .conf file, the DNS record and things that made no sense to check (like looking for your keys in the freezer). I’m totally at my wits end as to why 2 sites work and the other won’t connect at all.
Any thoughts or ideas?

So it is the same machine with one ip address, and you want to use different virtual hosts in Apache? Everything on a public ip, nothing with different routing internally with private ips?

Can you share your vhost config of apache?

You can ping the host with the nextlcoud-subdomain?

Yes, yes, and yes.

<VirtualHost *:80>

ServerName devrod.com
ServerAlias www.devrod.com	
DocumentRoot /var/www/devrod.com/html    
ServerAdmin webmaster@devrod.com

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined



<VirtualHost *:80>
ServerName lab.devrod.com
DocumentRoot /var/www/lab.devrod.com/html    
ServerAdmin webmaster@devrod.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


mycloud.devrod.com.conf UNABLE TO CONNECT

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mycloud.devrod.com
ServerName mycloud.devrod.com

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined


This last virtual-host config file is the site that is “unable to connect”. It is not rooted in an html directory as the other 2. But, that should not matter. At present the only files in all 3 is the Apache/Ubuntu index.html

All 3 are on the same hardware, same OS, same Apace installation. behind the same router and IP address. the router port forwards http-port: 80, & https-port: 443, to the server with the same address.

Pinging the server, gets a reply. As for pinging individual virtual-host, I don’t know how that would be done.

Note: I tested again from several sources with differing results;
Firefox on the same network says “unable to connect”
Chrome on the same network says “refused connection”
Browsers on 3 different phones and one tablet on the same network, “connect”, while my workstation I built the site via ssh will not connect. I’ve never had this issue before and don’t understand why I’m having it now.

Ah ha. On further reflection, after discovery of the final note, I found the issue. It was a misconfiguration in the Windows hosts file. Removed that and all’s well. Sorry to have wasted your time. However, it was me checking to make sure I wasn’t wasting time that put me on the right track. So thanks for that.

Just for debugging, you can take telnet:

telnet mycloud.example.com 80
then you get

Connected to devrod.com.
Escape character is '^]'.

and you can ask for some content:


In your case it works and gives a redirect to https. At this point, you would probably have seen that a different IP address was contacted.