Virtual hosts do not work as expected when accessing from internet

I’ve installed several virtual hosts:

The access from my local network (192.168.0.x) works fine. E.g https://sits.renesigi.ch gives the correct output in the firefox browser:

Accessing it from the internet or using the tor browser, the URL https://sits.renesigi.ch shows the following page is in the browser:

Something with the virtual host | httpd configuration must be probably wrong. Any idea what could be the problem?

1 Like

reproduce the error and check the httpd errors, sure the clues are inside

the two screenshot do not have the same URL

1 Like

That is exactly the point.

When I’m using firefox, edge, chrome or opera as a browser in my local area network (192.168.0.x), the correct virtual host home page is shown e.g. https://tagebuch.renesigi.ch edge shows:

Accessing it from the internet or using the tor browser, the URL (https://tagebuch.renesigi.ch) shows the following page is in the browser:

This is true for all configured virtual hosts shown in the picture at the beginning of my post. BUT if I’m using, a random invalid prefix to renesigi.ch e.g. https://gaga.renesigi.ch or only https://renesigi.ch the WordPress home page located in /usr/share/wordpress is shown:

So the standard WordPress httpd configuration seems to be correct but not the httpd configuration of the virtual hosts.

Some additional input:

I do not have a fix IP address for my domain renesigi.ch but I’m using DDNS to forward it to my IP address using at home. In the cable modem, NAT entries for the ports 21, 80 and 443 are configured that point to the local network IP address (192.168.0.103) of my NethServer.

dynu DDNS

@renesigi

Hallo René

At the moment, DNS resolves your domain name to the IP shown under your DynuDNS screenshot:

nslookup tagebuch.renesigi.ch
Server:		192.168.31.29
Address:	192.168.31.29#53

Non-authoritative answer:
Name:	tagebuch.renesigi.ch
Address: 77.57.177.135

anwi-mac-mpr15:~ aw$ nslookup -query=any renesigi.ch
Server:		192.168.31.29
Address:	192.168.31.29#53

Non-authoritative answer:
renesigi.ch	nameserver = ns3.dynu.com.
renesigi.ch	nameserver = ns6.dynu.com.
renesigi.ch	nameserver = ns2.dynu.com.
renesigi.ch	nameserver = ns1.dynu.com.
renesigi.ch	nameserver = ns5.dynu.com.
renesigi.ch	nameserver = ns4.dynu.com.
renesigi.ch
	origin = ns1.dynu.com
	mail addr = administrator.dynu.com
	serial = 880
	refresh = 1800
	retry = 300
	expire = 86400
	minimum = 300
Name:	renesigi.ch
Address: 77.57.177.135
renesigi.ch	mail exchanger = 5 mail.renesigi.ch.

Authoritative answers can be found from:

But neither with https or http is any webpage shown.
Either your DynuDNS doesn’t get the correct IP, or you have a different IP at home, and DynuDNS hasen’t got it yet…

I’m using UPC at home, they won’t give me a fixed IP. I’m using DynDNS, but it works…

I’d verify my IP eg with whatismyip.com .

My 2 cents
Andy

I cannot reach none of the URL you posted

1 Like

Sorry, but my NethServer HW was switched off due to save electricity and because the system is not really online since I’m using it primarily as a «NAS» system and not yet as a public webserver.

So currently, the server is not 24/7 online but is switched off overnight. This will be changed, as soon as I managed to handle the virtual hosts as I would expect :wink:

Please see the answer to @stephdl

1 Like

So I tried to reproduce the error as @stephdl proposed:

All my configured virtual hosts (tagebuch.renesigi.ch,sits.renesigi.ch,test.renesigi.ch, vision.jrise.ch) give the following output in the tor browser:

and generate the following httpd error logs located in /var/log/httpd/ /error_log :

[Thu Jun 25 08:09:09.071941 2020] [authz_core:error] [pid 11822] [client 131.255.4.96:45703] AH01630: client denied by server configuration: /var/lib/nethserver/vhost/tagebuch/
[Thu Jun 25 08:10:03.712966 2020] [authz_core:error] [pid 12128] [client 131.255.4.96:39475] AH01630: client denied by server configuration: /var/lib/nethserver/vhost/sits/
[Thu Jun 25 08:11:21.417617 2020] [authz_core:error] [pid 14750] [client 131.255.4.96:42299] AH01630: client denied by server configuration: /var/lib/nethserver/vhost/test/
[Thu Jun 25 08:11:45.015902 2020] [authz_core:error] [pid 14994] [client 131.255.4.96:34113] AH01630: client denied by server configuration: /var/lib/nethserver/vhost/vision/

So, something is missing/wrong in the virtual hosts httpd configuration file (/etc/httpd/conf.d/virtualhosts.conf)

After adding as is in zzz_wordpress.conf:

# RS added 2020-06-25 08:33
  Require all granted  

for each configured virtual host, the correct :slightly_smiling_face: :slightly_smiling_face: home page is shown even in the tor browser e.g. https://tagebuch.renesigi.ch/:

@renesigi

Salü René

I can confirm that all 4 websites seem to work from here and are visible (In Kreuzlingen, using UPC and a normal, current Firefox)…

Gruss
Andy

1 Like

Why, this is a common option that you can set in the menu of a vhost ???

1 Like

You’re right, but sometimes it is not that obvious, what the settings in the server manager panels really do, in this specific case probably the checkbox:

Allow access from trusted networks only

So I have selected the checkbox because I first wanted to test my web site locally and when everything is fine, and then to make these web site public.

Again many thanks :clap: for this helpful hint :+1:.

1 Like