Score:0

Apache make site available to intranet and internet over same domain name

us flag

This is probably a stupid question, but I can't seem to find a solution to it.

Following scenario: https://sub.doma.in:443 is hosted on my Apache server at home. Works great when connecting from outside. Also works great when connecting from the same network on my computer. However, my phone cannot connect from the same network (ERR_CONNECTION_TIMED_OUT). So something must be wrong.

I want either: To make any connection to sub.doma.in go over the internet to my hosted site. That's how it is at the moment, I think, but it doesn't work with all devices.

Or (preferably): To make connections to sub.doma.in from the intranet connect to the internal IP directly without getting routed outside first.

Everyone should always end up at the same site, no matter where they're connecting from.

Firewall allows 80 and 443 from anywhere, router has port 443 open only. If you need any config files or logs just tell me. Any help is very much appreciated! :)

My current vhost for the site looks like this:

<VirtualHost *:80>

    ServerName sub.doma.in

    Alias /.well-known/acme-challenge/ /usr/share/webapps/acme

    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

</VirtualHost>

<VirtualHost *:443>

    ServerName sub.doma.in

    SSLEngine on
    SSLCertificateFile xxx
    SSLCertificateKeyFile xxx
    Include xxx

        Protocols h2 http/1.1

        Header always set Strict-Transport-Security "max-age=63072000"

    CustomLog "xxx" common

    DocumentRoot xxx
    DirectoryIndex index.php index.html

    <Directory xxx>
        Require all granted
                AllowOverride All
                Options FollowSymLinks MultiViews
    </Directory>

    <IfModule mod_dav.c>
        Dav off
    </IfModule>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:xxx|fcgi://localhost/"
    </FilesMatch>

</VirtualHost>

Score:0
ru flag

Do you access the website on the same mobile phone when you are outside your network? Does the error only occur on this one phone? Here are a few possible reasons why it could be: The simplest reason: It could be a cache problem on your phone. The best way to do this is simply to google how to clear your DNS cache.

Do you definitely connect to your cell phone via https? Http will not work because port 80 is not open in the router.

Is your DNS configured correctly with your domain provider? It is best to test this with a DNS checker (also just google it)

Another problem I could think of would be that you have an adblocker in your home network that could block this page.. Something like Pi Hole... Some people have that by now, something like that could lead to problems. I hope I could help.

us flag
Thanks for your help. It turned out it has something to do with the WiFi the server is connected to at the moment. If it's on the 2.4GHz net other devices on the 2.4GHz net can't connect, but LAN and 5GHz work. And vice versa. So I guess it's an issue with the router. I ended up setting up dnsmasq and setting the IP for the website to the internal address locally. Now it's working.
Score:0
us flag

It turned out it has something to do with the WiFi the server is connected to at the moment. If it's on the 2.4GHz net other devices on the 2.4GHz net can't connect, but LAN and 5GHz work. And vice versa. So I guess it's an issue with the router. I ended up setting up dnsmasq and setting the IP for the website to the internal address locally. Now it's working.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.