How to add >500 domains

hip_

New member
Joined
Aug 29, 2007
Messages
1
Hello,
maybe someone do that or know how to. I have DA installed on my own server and now i need to add more then 500 domains. It takes a lot of time to do that manually. Maybe use some script or something like that. I'm not a programmer, so this is why i asking. Any thoughts?

Thanks a lot
 
...good question :) ...I wish I knew.... :)

PS
I wonder if you want that just for one user and 500 domains, or for a lot of users.... and each user have a few... hmmmm

There has to be a way ... by connecting to DA and create users thru it in automated/scripted way....

Can someone show a piece of code.... how it's done.... for at least one :D
 
Last edited:
I would never entertain the thought of adding 500 sites to a server, not even if they are simple redirects. Good luck with your loads, spam and resource limits.
 
pucky,

You can't presume that everyone's experience is the same as yours. Many webhosters (not us, but some of our clients) have no problem at all with hundreds, some thousands, of domains on a single server. Often the sites are all their own and are simple door sites for use with SEO.

Jeff
 
hip,

It might also help to look into this thread.

Edit: Didn't notice the thread was already linked in the link Jlasman gave you. Ohwell :)
 
Last edited:
Hello,
maybe someone do that or know how to. I have DA installed on my own server and now i need to add more then 500 domains. It takes a lot of time to do that manually. Maybe use some script or something like that. I'm not a programmer, so this is why i asking. Any thoughts?

Thanks a lot

I wrote a Bulk Domain and Subdomain Plugin that can do this, however there is currently a bug in DA's CMD_API_DOMAIN API preventing it from working properly.

I tested the plugin today (DA v1.30.2 on CentOS) and it adds bulk sub-domains perfectly using DA's CMD_API_SUBDOMAINS API, but the same method doesn't work on CMD_API_DOMAIN. Instead, CMD_API_DOMAIN exits (with no output) half way through adding a domain. DA then won't let me add another domain with the same name, but the half-added domain does not show up on DA's list of domains for the user. I think the CMD_API_DOMAIN bug only occurs when plugins are accessing it.

I could have a look at implementing a completely different method to add bulk domains, but that will need to wait until at least Tuesday.

Cheers,
 
Bug? Perhaps try adding a slight delay between each domain in case DA hasn't finished cleaning up the domain addtions in the previous request.. also report any errors (if any) that are returned..(domain already exists? check the named.conf)

John
 
This happens when adding just one domain.

DA CMD_API_DOMAIN doesn't give any output itself. It's a completely empty reply. (See my next post for log output.)

DA CMD_API_DOMAIN adds the domain to named.conf, puts files inside /usr/local/directadmin/data/users/USER/domains/, and adds a virtualhost to /usr/local/directadmin/data/users/USER/httpd.conf. However, the domain does NOT get appended to /usr/local/directadmin/data/users/admin/domains.list and does not show up in the DA GUI.

If I then manually append the domain to domains.list, the domain DOES show up in the GUI and it appears to be working fine.

I only see this problem when calling CMD_API_DOMAIN from within a plug-in.

Cheers,
 
Last edited:
Update: I thought I'd try my plugin right now to capture any log output. Here's the new output from each DA log.

/var/log/directadmin/error.log
Code:
2007:09:04-03:19:11: ConfigFile::writeFile(/usr/local/directadmin/data/users/admin/ftp.passwd) : Timestamp from when it was read is different, overwriting anyway
2007:09:04-03:19:11: File ./data/users/admin/user.usage has been written to after this process read it.  Not going to overwrite it.
2007:09:04-03:19:11: File ./data/users/admin/reseller.usage has been written to after this process read it.  Not going to overwrite it.

/var/log/directadmin/system.log
Code:
2007:09:04-03:20:08: httpd restarted
2007:09:04-03:20:09: named reloaded
2007:09:04-03:20:10: proftpd rereaded

/var/log/directadmin/2007-Sep-04.log
Code:
04/09/2007:03:19:10     71.230.123.249 POST /CMD_PLUGINS/bulkdom HTTP/1.1       admin
04/09/2007:03:19:10     127.0.0.1 GET /CMD_API_SHOW_DOMAINS HTTP/1.1    admin
04/09/2007:03:19:10     127.0.0.1 GET /CMD_API_DOMAIN HTTP/1.1  admin

(CMD_API_SHOW_DOMAINS is called prior to the call to add a domain or sub-domain because the tool has to determine if it's adding is a sub-domain of an existing domain.)

None of the other logs have anything new.

Hope that helps.

Cheers,
 
pucky,

You can't presume that everyone's experience is the same as yours. Many webhosters (not us, but some of our clients) have no problem at all with hundreds, some thousands, of domains on a single server. Often the sites are all their own and are simple door sites for use with SEO.

Jeff

Im going by experience thanks. Look we manage enough servers to know what issues arise from having hundreds of sites on a server. We have one client who cant work it out. He has 1024 and 800 sites on two servers. They are nothing but redirects, no mysql, no php nothing but the box is always loaded up even on a dual processor then he wonders why. Even simple redirects are going to load up a box whether they are html sites or redirects. It only takes one DOS attack or a mail server attack to bring down the box with that many sites on it. I stand my ground on this subject speaking from managing servers for years and years generally i have a pretty good idea what im talking about. I said, 500 sites is a ridiculous number of sites on a server then i read 47k in sites which i find pretty absurd. I would never host with a company that overloads a box like that i dont care what they host.
 
Phil, are you creating the domain under the admin account by chance? If you're already accessing admin to run the plugin, then the domains.list is controlled by the plugin instance, which will have the "last word" (last overwrite) ... try using a different user other than admin to see if that changes things.

Let me know if that does work for a different user.. as that's likely what's going on... or even test it out from a remote server instead. I'll double check to see if there is anything I can do about having it not rewrite the user files for plugins, as it really shouldn't be needed anyway.

John
 
Phil, are you creating the domain under the admin account by chance? If you're already accessing admin to run the plugin, then the domains.list is controlled by the plugin instance, which will have the "last word" (last overwrite) ... try using a different user other than admin to see if that changes things.

Let me know if that does work for a different user.. as that's likely what's going on... or even test it out from a remote server instead. I'll double check to see if there is anything I can do about having it not rewrite the user files for plugins, as it really shouldn't be needed anyway.

John
John,

Thank you for the quick reply. :)

You are right; I was testing as "admin". However, I just tried with two different regular users (not resellers), and both users resulted in seemingly the exact same outcome as "admin" did; the domain shows up everywhere except domains.list, logs have same output, etc..

I can send you a PHP file to reproduce the issue if you wish, but reproducing this should be as simple as calling CMD_API_DOMAIN to create a domain from within a plugin (using the plugin session cookie method to gain API authorization).

Cheers,
 
Just going through my todo list and notice this still needs looking at. If you can send me a sample script to suppport at directadmin.com, I'll see what the problem is.

John
 
Back
Top