0

In my office setup I have Windows 10 machine with Linux on virtual machine (Turnkey Linux installed on VirtualBox with bridged setup). Let's call it server. 

  • The server runs apache and owncloud. 
  • The server is accessible to the outside world trough public IP and our subdomain (DNS are pointing to public IP).
  • It has Let's encrypt certificate installed. 

Everything works fine when I access server from outside. The web-server is accessible both via IP and subdomain (it's serving proper content). However, when I try to access it from LAN, it works only via local IP address. When I try to use public IP or domain, I get error message ERR_EMPTY_RESPONSE in browser.

Error log shows that apache is shutting down for some reason (only when accessed from LAN via domain or public IP). It happens both in HTTP and HTTPS settings.

[Thu May 27 15:02:10.985765 2021] [mpm_prefork:notice] [pid 2889] AH00169: caught SIGTERM, shutting down
[Thu May 27 15:02:11.481503 2021] [mpm_prefork:notice] [pid 3111] AH00163: Apache/2.4.38 (Debian) OpenSSL/1.1.1d configured -- resuming normal operations
[Thu May 27 15:02:11.481570 2021] [core:notice] [pid 3111] AH00094: Command line: '/usr/sbin/apache2'

No IPs are blocked. DNS are correctly resolving domain to public IP.

Does any one have an idea how to find some answers?

  • "Error log shows that apache is shutting down for some reason" -- I think it's not the *entire* Apache shutting down. See [this question](https://serverfault.com/q/607873). – Kamil Maciorowski May 28 '21 at 07:26
  • It confirms my suspicions that it could be somehow connected to NAT (host can't resolve request to itself). Unfortunately my router doesn't support hairpin NAT. I'm just wondering if this could be fixed by mapping addresses in Windows host file? I tried to play around with it, but I'm not sure if my approach was correct. – Tomasz Maciąg May 28 '21 at 09:53
  • Adding popper mapping in windows host file resolved the issue. I added entry serwer-local-IP public-domain. I need to figure out how to do this for whole LAN, instead of on – Tomasz Maciąg May 28 '21 at 10:17

1 Answers1

1

This topic explains why this was happening. Thanks Kamil for pointing me to right direction.

In my case I fixed the problem by adding mapping in Windows host file.

192.168.1.37 sub.domain.com

Where 192.168.1.37 is local IP of my serwer. The host file needs to be modified on every LAN machine. Making it work for whole LAN would require router with hairpin NAT or on-lan DNS server.