I’m trying to set the website that is shown, when accessing the server with an ip-address.
I have several ips set up, on one IP there is only one website hosted. Needless to say, it shows the right website when I try to access the ip.
On another ip there are several domains with subdomains and the current default seems to be the first one found in /sites-available in alphabetic order.
Can I set up another default site for the IP? If so, where?
That’s an interesting side effect of the Debian way of handling virtuals.
Apache has two modes of operation, and when it is configured for virtual hosting the “default” virtual server becomes the first one defined in the VirtualHost sections, as you’ve noted.
You’ve probably got two options:
Rename the sites-available filename for the domain you want to be the "default" to be always before the others. 0virtualmin.com.conf for example.
Add a VirtualHost section to the Apache configuration file before the include line that leads to the loading of the sites-available files.
Hmm, renaming would be easy, but would this not break the maintenance via Virtualmin?
Crap, you’re right. I don’t have a good solution to this one!
Maybe make a dummy version of the site that is identical in every way, but is outside the control of Virtualmin. (i.e. rather than renaming it, copy the file and the make up some random domain name that you’ll never use.)