Browsing to server on local network

SYSTEM INFORMATION
SYSTEM INFORMATION
---------- ----------
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.620
Usermin version 2.520
Virtualmin version 8.0.0 Professional
Theme version 26.20.2
Apache version 2.4.52
Package updates All installed packages are up to date

I have virtualmin hosting a website, how to I get to it locally something like

192.168.0.100/webtrees

Keith

In the Virtualmin panel for the VM(website) use the Menu on the left

Web Configuration → Preview Website

Easiest way :grinning_face_with_smiling_eyes:

I just used that menu a few days ago while testing Virtualmin on my home local network

Humm when I select the new VM and then goto Web Configuration → Preview Website all it does it bring up the Virtualmin site

Is Virtualmin running in a Virtualized environment? I had my test setup running in a VirtualBox VM and all worked fine.

Have you tried localhost/MyWayCoolAwesomeWebsite.com or 127.0.0.1/MyWayCoolAwesomeWebsite.com

Now sure how you setup DNS and all that

Is this website publicly available on the internet?

If so you need to enable NAT loopback on your router or add a DNS entry to your hosts file.

What does “locally” mean here? Why wouldn’t you just go to the domain name? Or are you on a consumer router that doesn’t route the external IP to the local network, so the domain name resolves to the public IP and you can get to it from the local network?

If that’s the case, the simplest is to add that IP to your hosts file so you can access it on its name. You’ve got name-based virtual hosts in Apache, so an IP alone can only ever take you to the first configured VirtualHost.

You could make it available on a path within an IP-based VirtualHost, or on a path in the first VirtualHost (whatever VirtualHost you get when you visit http://192.168.0.100). That’d be problematic, though, for anything short of a plain HTML site, without a lot of hoop-jumping to deal with the PHP-FPM configuration in a way that works.

You can configure BIND to serve different views, but that’s probably way too much complexity for one or two client machines (and would depend on you hosting DNS locally).

Anyway, for me, I would just put it in the hosts file.

What does “locally” mean here? A small network I have setup at home, part of it will not be accessible to the internet

Do you have any examples of the configuration files to accomplish reaching it only from within my home network

Thanks
Keith

The configuration is no different. The problem is the DNS server you’re presumably querying doesn’t resolve that name to your local IP.

So, as I said, the simplest thing is to add that name to your hosts file on your client system. Unless you want to run a DNS server locally just to make those local sites available, that’s the only reasonable option. You need to be able to browse to the name of your VirtualHost to be able to visit more than one on a given IP, whether it is local or not.

  • NAT loopback on router
  • SplitDNS on router (add local IP entry for your website)
  • host file on your PC

Any of these will do, but as @Joe says the host file entry on your PC is the easiest but it only works for that pc, not the whole local network.

1 Like