Need advice for special kind of sub-server config

7 posts / 0 new
Last post
#1 Sun, 09/07/2008 - 03:22
balzercomp

Need advice for special kind of sub-server config

Hi everyone,

I need to do the following setup:

I have a "main-domain", let's call it "maindomain.com". To allow several different and totally separate users to test a joomla-based software product, I want to setup several subservers called "sub001.maindomain.com", ... "sub150.maindomain.com". They should have separated file- and db- access.

How would you solve this?

If possible I'd like to generate the subs automatically (e.g. by using "Batch Create Servers"). Is this possible?

Thanks

Gerald<br><br>Post edited by: balzercomp, at: 2008/09/07 03:23

Tue, 09/09/2008 - 22:09
balzercomp

Sorry, but is this such a stupid question, or has no-one a possible solution?

Gerald

Sun, 06/07/2009 - 07:29
Joe
Joe's picture

Why do you want them to be sub-servers? If they are for different users they aren't sub-servers. A sub-server is a virtual server owned by an existing user.

For creating a large number of identical domains, you could easily do what you're after with the command line tools.

[code:1]
for i in `seq 0 150`; do
pass=`echo $i | md5sum`
virtualmin create-domain --domain sub$i.maindomain.com --pass ${pass:0:8} --template &quot;YourTemplate&quot;
echo &quot;Domain: $sub$i.maindomain.com Password: ${pass:0:8}&quot; &gt; domainlist.txt
done
[/code:1]

Just create a Server Template that has all of the features you want, including Joomla and, optionally, anything you'd want to also be installed in the skel (you can use a custom skel, if it needs to be different from the usual on your system).

Or, you could use Batch Create Servers to do the same thing by creating a batch file. Same basic concept:

[code:1]
for i in `seq 0 150`; do
pass=`echo $i | md5sum`
echo &quot;$sub$i.maindomain.com:${pass:0:8}&quot; &gt; domainlist.txt
done
[/code:1]

You'd then use &quot;domainlist.txt&quot; as the batch file, and select the right template from the dropdown. No real difference between the two processes, except the former does it all from the command line and generates a human readable domainlist.txt file, while the latter file is both machine and human readable (maybe not as human readable, but good enough for you to pick out the domain and password so you can notify the user how to login).

This is a pretty simple example, of course, and it could be expanded to do all sorts of nifty things. Like pulling in email addresses from a list and associating each with a virtual server, and automatically emailing them when the server is created--allowing you to skip the step of picking out the password and sending out the email yourself.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:29
Joe
Joe's picture

Why do you want them to be sub-servers? If they are for different users they aren't sub-servers. A sub-server is a virtual server owned by an existing user.

For creating a large number of identical domains, you could easily do what you're after with the command line tools.

[code:1]
for i in `seq 0 150`; do
pass=`echo $i | md5sum`
virtualmin create-domain --domain sub$i.maindomain.com --pass ${pass:0:8} --template &quot;YourTemplate&quot;
echo &quot;Domain: $sub$i.maindomain.com Password: ${pass:0:8}&quot; &gt; domainlist.txt
done
[/code:1]

Just create a Server Template that has all of the features you want, including Joomla and, optionally, anything you'd want to also be installed in the skel (you can use a custom skel, if it needs to be different from the usual on your system).

Or, you could use Batch Create Servers to do the same thing by creating a batch file. Same basic concept:

[code:1]
for i in `seq 0 150`; do
pass=`echo $i | md5sum`
echo &quot;$sub$i.maindomain.com:${pass:0:8}&quot; &gt; domainlist.txt
done
[/code:1]

You'd then use &quot;domainlist.txt&quot; as the batch file, and select the right template from the dropdown. No real difference between the two processes, except the former does it all from the command line and generates a human readable domainlist.txt file, while the latter file is both machine and human readable (maybe not as human readable, but good enough for you to pick out the domain and password so you can notify the user how to login).

This is a pretty simple example, of course, and it could be expanded to do all sorts of nifty things. Like pulling in email addresses from a list and associating each with a virtual server, and automatically emailing them when the server is created--allowing you to skip the step of picking out the password and sending out the email yourself.

--

Check out the forum guidelines!

Tue, 09/09/2008 - 23:09
Joe
Joe's picture

Oh, yeah, this is untested. I just whipped it up. I'd suggest trying it with a small range first to be sure it does what you want, so cleaning up will be easy.

Change the &quot;seq 0 150&quot; to &quot;seq 0 3&quot; to create four virtual servers, rather than 151.

--

Check out the forum guidelines!

Wed, 09/10/2008 - 00:45 (Reply to #5)
balzercomp

Thanks a lot. I'll give it a try.

Sun, 06/07/2009 - 07:29 (Reply to #6)
Joe
Joe's picture

Ooh, there's a typo.

The echo line should use &gt;&gt; instead of &gt;. Otherwise it'll empty the file before each write. ;-)

So, this would be more sane:

echo &quot;$sub$i.maindomain.com:${pass:0:8}&quot; &gt;&gt; domainlist.txt

--

Check out the forum guidelines!

Topic locked