default database names

13 posts / 0 new
Last post
#1 Thu, 08/11/2011 - 18:14
robbrandt

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 domain1.com, last year was at 2010.domain1.com, this year at 2011.domain1.com, next year at 2012.domain1.com. When we roll over to a new year, I set an alias of the current year as domain1.com 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 2011.domain1.com, 2011.domain2.com and 2011.domain3.com 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?

Mon, 08/15/2011 - 13:47
robbrandt

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

Tue, 08/16/2011 - 05:50
Locutus

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.

Tue, 08/16/2011 - 10:52
robbrandt

Excellent, thank you. Never saw those settings before.

Tue, 08/16/2011 - 15:25
Locutus

Yep, Virtualmin has too many of those. ;)

Thu, 08/18/2011 - 03:40
-eclipse-

Hi Locutus

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

-Tim

Thu, 08/18/2011 - 07:53
andreychek

This list here contains many of the available variables:

http://www.virtualmin.com/documentation/id%2Ctemplate_variable_listing

Thu, 08/18/2011 - 11:16 (Reply to #7)
robbrandt

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

Thu, 08/18/2011 - 08:19
-eclipse-

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
Thu, 08/18/2011 - 08:24
andreychek

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 :-)

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

-Eric

Thu, 08/18/2011 - 08:27
-eclipse-

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
Wed, 03/14/2012 - 07:20
-eclipse-

Hi Eric

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

  • Tim
Wed, 03/14/2012 - 09:16
andreychek

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

-Eric

Topic locked