Fresh install, all domains show /var/www/html/index.html instead of ~/public_html/index.html

OS:
Ubuntu Server 20.04 Virtual Machine with IP 192.168.0.81 on XCP-NG

Network Configuration:
Home Network with Public Static IPv4 20.20.20.20, Modem/Router is configured to use 192.168.0.81 as DMZ Host (All Ports are forwarded to a Specific IP, exposing it to the Internet

Hostname:
web-server.example.com which can be accessed in other networks as well. Example.com has ns1, ns2 records

Problem Description:
All domains use /var/www/html/index.html instead of /home/user/public_html

What process I have done:
1.fresh installed Ubuntu Server 20.04
2. sudo update, upgrade
3. Installed virtual min from the Public available script
4. Virtual min asked for FQDN entered web-server.example.com
5. Visited 192.168.0.81:10000 for post install
6. Before doing post install, changed shared IP address in System Settings > VirtualMin configuration > Networking from 192.168.0.81 to 20.20.20.20
7. Ran post install wizard. Let’s Encrypt certificates were successfully generated as well as, DNS Records, virtual server.

Problems:

  1. After that, no matter which website I visit which is hosted on Virtual Min, the Apache 2 Linux Ubuntu webpage is rendered.

  2. If I try to visit https//example.com my browser shows an SSL Error Message. However if I visit https://example.com:10000 I can visit Virtual Min with a valid SSL certificate

Any suggestions?

@MariosX,

You did not need to change the “Shared IP Address” for your setup. Virtualmin is smart enough when it’s appropriate to make use of your “Public IP Address”. However technically on your server, your “Private IP Address” should be used in order to resolve websites to the appropriate Virtual Server.

Fix that, and you likely will have your problem resolved.

1 Like

Is 20.20.20.20 an address on the Virtualmin system? This change can’t possibly work if it is not.

The DNS records need the public IP. The virtual hosts need the address on the server itself.