Web Hosting Talk







View Full Version : Adding Bulk sub-domains


Furton
04-04-2002, 02:34 PM
I've just aquired a rather large site which also needs 30 sub-domains for hosted sites, before I go through the long procsess of adding them all manually (I have no CP) is there anyway to add a bulk amount of sub-domains?

kunal
04-05-2002, 04:09 AM
it shouldnt be to hard to write a script for doing something like this... i dont know of any pre-written one though..

Furton
04-05-2002, 07:28 AM
Well I've just finished adding them all, if anyone has some sort of script to do this I would like to know about it.

Starhost
04-05-2002, 08:46 AM
What is it exactly that you want? I know their are some options available. But can't figure out of what you precisly want to do, so please explain :-)

Furton
04-05-2002, 09:01 AM
A script that will allow me to add domains, sub-domains, and a new user to my server, currently I'm doing it all manually, which takes time.

Starhost
04-05-2002, 09:27 AM
See www.webmin.org or webcp.can-host.com

But what you are looking for is a control panel vor a administrator only And I don't think their are a lot off products offering the things you want for free.

4solutions
04-05-2002, 01:38 PM
Originally posted by Starhost
See www.webmin.org or webcp.can-host.com Looks like it's www.webmin.com ;) --- easy mistake

Starhost
04-05-2002, 02:03 PM
Sorry for the wrong url. I guessed it was .org because it is free. Sorry.

bitserve
04-05-2002, 11:48 PM
I would recommend learning a scripting language so that when these types of issues come up in the future you can write your own custom scripts.

As a system administrator, you will often find the need for a script to simplify your work.

You might want to start with:

man sh

Or if you have perl installed:

man perl

I doubt that the type of script that you required was just laying around somewhere available to download. If someone had a server set up exactly like yours it's possible that they had written a script to do the same thing and would have shared it with you. But you didn't say how you were set up, and it would have taken longer to determine that then it would have taken to write a new script.

Good luck.

cyrusTvirus
04-08-2002, 06:30 AM
Webmin is not very suitable for bulk adding I think ?? You still have to do a lot manually i think.....

I have no suggestions for a better one though.... we are using webmin also..... suggestions are more then welcome....

Perhaps some sort of GUI which enables clients to add subdomains them self.....

Starhost
04-08-2002, 10:01 AM
To be honest I don't think there are GUI's that will let you add bulk subdomains. You have to pay for all of those scripts, which is quite obvious.

The only one I know and that is free is webcp (http://webcp.can-host.com).

Ahmad
04-08-2002, 12:58 PM
What I would do in your case is set a small redirect rule up so that:

anything.domain.com

gets served from:

/www/anything

This is done using mod_redirect in Apache.

You can do some checking first too, like look if there is actually a directory called 'anything' before trying to server the content from over there. If there isn't, the user will get redirected to an error page or whatever. Adding subdomains later will be a matter of creating subdirectories.

Starhost
04-08-2002, 01:01 PM
And adding subdirs can easliy be done by a simple PHP script :-)

Furton
04-08-2002, 05:10 PM
Got any examples?

Starhost
04-08-2002, 05:39 PM
http://php.proserve.nl/manual/en/function.mkdir.php

There you find soem examples, it isn't that hard :) Just a few lines of code :) If you can't handle it, then contact me throw icq (see profile). Then I'll help ya.