1

Edit 3:

Weird discovery. This problem is only happening from one specific client. All three sites are accessible via domain name from any computer except my primary desktop. This desktop can only access the server (for HTTP or for SSH) via the local IP address 192.168.0.X not via the external IP or the domain name(s). From all other machines, everything works as expected.

I checked my fail2ban logs and firewall to make sure this specific machine wasn't getting blocked. What else could the problem be? It's a huge pain to not be able to access my server from my primary desktop.

Both are hard-wired to the same router via ethernet cables, if that matters.


Original Post:

I have three virtual hosts defined in Apache (all three with .conf files stored in /etc/apache2/sites-available that have been enabled via a2ensite).

Prior to updating from Ubuntu 16.04 to Ubuntu 18.04, all three worked fine. After updating, none of them would load in the browser, so I did a lot of troubleshooting. Here is what I have done/double-checked so far:

  • Reinstalled apache2 and php
  • Checked apache2.conf, including running apache2ctl -t to debug - there are no errors.
  • Checked conf files for each site, ran apache2ctl -S to ensure all were recognized. Each one specifies the ServerName (domain name) and DocumentRoot (local directory). These values have been triple checked for correctness.
  • Checked DNS settings. All three domain names do point to the correct IP address (used dig to confirm).
  • Checked firewall settings - port 80 is open and Apache is listening on it.

When accessing any of the three sites by domain name, the browser gives the error message: "This site can't be reached. domain.com took too long to respond."

I can access the default site (the first one loaded by Apache) with no problem if I type the IP address in the browser instead of the domain name.

I feel like this is some sort of Apache configuration I'm messing up somehow but all I have is the default apache2.conf file from fresh installation along with the virtual host conf files, which all have the following format:

<VirtualHost *:80>
    ServerName somedomain.com
    DocumentRoot "/var/www/foldername"
    <Directory /var/www/foldername>
        Options -Indexes
        AllowOverride XXXXXXXXXX
    </Directory>
</VirtualHost>

The AllowOverride is None for one site and Fileinfo Options for the other two.

Any idea what I'm missing?


Edit 1: Adding output from dig, ping, and curl

angela@pop-os:~$ dig mydomain.com

; <<>> DiG 9.11.5-P1-1ubuntu2.5-Ubuntu <<>> mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65412
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;mydomain.com.          IN  A

;; ANSWER SECTION:
mydomain.com.       1799    IN  A   MY_SERVER_IP

;; Query time: 60 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sat Aug 31 23:54:55 EDT 2019
;; MSG SIZE  rcvd: 57

angela@pop-os:~$ ping mydomain.com
PING mydomain.com (MY_SERVER_IP) 56(84) bytes of data.
^C
--- mydomain.com ping statistics ---
18 packets transmitted, 0 received, 100% packet loss, time 415ms

angela@pop-os:~$ curl -v mydomain.com
* Expire in 0 ms for 6 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
*   Trying MY_SERVER_IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x558ffb3d7880)

Edit 2: Adding output for curl ip_address and also for netstat.

angela@pop-os:~$ curl -v MY_SERVER_IP
* Expire in 0 ms for 6 (transfer 0x5601183bb880)
*   Trying MY_SERVER_IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x5601183bb880)
* connect to MY_SERVER_IP port 80 failed: Connection timed out
* Failed to connect to MY_SERVER_IP port 80: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to MY_SERVER_IP port 80: Connection timed out
user@server:~$ sudo netstat -anp | grep apache
tcp6       0      0 :::80                   :::*                    LISTEN      28228/apache2 
9
  • The error you are giving sounds more indicative of a DNS or domain resolution issue. Can you show that the domain is resolving correctly maybe using ping and curl -v your domain.com to prove the issue might be elsewhere? – Andy Shinn Sep 1 '19 at 3:50
  • Added output from dig, ping, and curl to the original post - all three appear to be finding the correct IP address (identified by MY_SERVER_IP in the output above). – angelax Sep 1 '19 at 3:59
  • The curl output looks strange to me... can you also curl.just the IP address to see that it returns the HTTP headers of the default vhost? The current curl output doesn't seem to output any headers which is concerning. But definitely looks like maybe it is Apache not listening on the domain vhost correctly. – Andy Shinn Sep 1 '19 at 4:07
  • Ah, the extra "expire in" curl stuff may actually be some debug stuff that slipped in a release: curl.haxx.se/mail/archive-2019-02/0013.html – Andy Shinn Sep 1 '19 at 4:15
  • Added the curl output you suggested to original post; also added netstat output from the server. – angelax Sep 1 '19 at 4:15
0

I'm not sure if this is the "right" solution, but it worked for me. In the end, all I did was add a line to /etc/hosts on the "broken" client that could not connect to the server. I put the internal IP address (which I have my router set up to keep the same for all of my main devices, including my server) followed by a space separated list of the domains hosted on that server. Example:

192.168.0.1     domain1.com domain2.com domain3.com sub.domain3.com

This doesn't seem like a good, dynamic, permanent fix. But it solves the problem for now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.