So, I checked that out and, after restoring my VM from a virtual backup (exported earlier than MYSQL configuration or the Nextcloud install), I did the following:
I configured MYSQL:
CREATE DATABASE IF NOT EXISTS <MySQL DB Name> CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER '<MySQL DB Username>'@'localhost' IDENTIFIED BY '<MySQL DB User Password>';
GRANT ALL PRIVILEGES ON <MySQL DB Name>.\* TO '<MySQL DB Username>'@'localhost';
FLUSH PRIVILEGES;
As far as I know, when using name-based virtual hosts, Apache looks for a matching ServerName or ServerAlias directive. If it doesn’t find a matching one, which is the case when you’re connecting via IP address, it falls back to the first virtual host in the configuration. On a default Debian installation, this is usually 000-default.conf.
So make sure that the default virtual host is either disabled using
a2dissite 000-default.conf
or that you’re actually accessing the site via the hostname configured in ServerName rather than by IP address.
Alternatively (although I’m not 100% sure whether this would actually work), you could try setting ServerName to the IP address or adding the IP address as a ServerAlias. Obviously, this would only work for a single virtual host unless your server has multiple IP addresses. So if you’re hosting multiple sites or services on that server and want to access them via IP address, you’d have to use subdirectories rather than separate virtual hosts.
From my own experience, accessing any web or Nextcloud servers via IP is PITA. Do you have a local DNS server? You should access your Nextcloud instance using a valid domain and yes that should match the name of the virtual host in Apache otherwise Apache will serve you the default home page.
When you access your server via its IP address then Apache will default to the um… default Apache home page. Apache expects a domain name that matches the name of the virtual host.
You may be able to work around this if you reconfigure Apache and disable the default home page or point it to your Nextcloud directory (not even sure if that’s possible) but it’s a dirty solution. Having a DNS and proper domain name is the right way.
This is required if you want to host multiple services on the same machine: mine is a NAS, a web server with two sites and a Nextcloud server, all accessed via different URLs. Even if you’re just testing NC in a VM it’s better to do this the right way so you get used to it.
If you don’t have a local DNS then you may try adding the Nextcloud domain and IP address to your hosts file.
UPDATE: I’ve finally got Nextcloud (my ultimate aim in all this) working on my mini-PC using Docker Desktop and Nextcloud AIO… just need to figure out how to back the install up now.
NOTE: I’m aware that DD for Win is being “deprecated” and “the service” is going in December although I’m unsure how that will affect a local installation.