default database names

I would like to manage my new server with Virtualmin but right away I see a little problem that I hope can be fixed.

We host certain domains that “roll over” their content every year, with the prior years serving as archives. Each year is specified with the year as a subdomain. So, for example, for, last year was at, this year at, next year at When we roll over to a new year, I set an alias of the current year as so that the “main” domain is always pointed to whatever the current subdomain is.

The problem as I see it is that we do this for several domains. It will be common for us to have, and all active at the same time. When Virtualmin creates databases for these subdomains, it names the database strictly by subdomain only. In other words, each of the examples above will try to have a database created named “2011”.

How do I make it create databases that include the full domain name, or otherwise prevent name collisions?

Anyone? There’s not a template I can edit somewhere?

Check out the Server Template, section MySQL Database. You can set the “Default Database Name” there, and can use substitution variables to tweak the name to your liking.

Excellent, thank you. Never saw those settings before.

Yep, Virtualmin has too many of those. :wink:

Hi Locutus

Are there any list of the available substituion variables which can be used throughout the Virtualmin?


This list here contains many of the available variables:

Hi Eric

What about a variable creating a random number with defined ciphers, such as $rand4 to create a random number with 4 ciphers?

That way you could create DB’s with a random number as well, such as 3713scrooge

Or something similar to avoid multiple domains with the same name in it?

  • Tim

That’s amusing, in the several years I’ve been in the forums here, I’ve never heard of someone asking for a random number. But you’re the second one to ask this week :slight_smile:

I’ll talk to Jamie to see if that’s feasible to add something like that.


Hi Eric

I am glad to give some extra ideas to the new releases.

The random function may be usefully in other places too, such as the username so that when you create a site named cke.tld it will be more than just cke.
That will also harden the possibility to force entry to the system.

  • Tim

Also, I think there’s a Help link on each page that’s relevant that shows a context sensitive list of variables.

Hi Eric

I think we got at spammer on the forum :slight_smile:
Have you had the time to look at the request above regarding the random numbers to the database names?

  • Tim

Try using the variables $RANDOM1 - $RANDOM10 and see if that does the trick for you, I think Jamie has indeed implemented that.