PDA

View Full Version : Problems with subdomains


bakon
09-01-2004, 11:02 AM
Now when you enter a subdomain that no exists of a site that exists at the server it does goes ok.
For example:
mail.site.com goes to the first site declared on Apache (perhaps not "site.com")

1) Could that entry be created automatically when a site is added at the server?

2) Could it be done for any subdomain possible, so for example:
XXXXX.site.com goes to site.com

Thank you.

Igor
09-06-2004, 02:46 AM
just add XXXXX.site.com to site.com aliases,
DNS record will create automaticaly.

bakon
09-06-2004, 12:37 PM
just add XXXXX.site.com to site.com aliases,
DNS record will create automaticaly.

Ok, but it has to be done for each site in the server manually (I have 140 sites in a server).

I asked to do it:
1) Automatically.
2) Done for any subdomain possible.

Thank you.

Igor
09-07-2004, 05:28 AM
you can use API for add xxxxxxxx.site.com alias to all your sites

example perl script for this task:
==============================================
#!/usr/bin/perl

@SITES = `fetch -qo - "http://localhost/manager/ispmgr?out=text&func=site"`;

foreach (@SITES) {
chomp;
$name = (split(/\s/))[0];
$site = (split(/=/, $name))[1];
print "$site\n";
$info = "";
@PROP = `fetch -qo - "http://localhost/manager/ispmgr?out=text&func=site.edit&elid=$site"`;
foreach(@PROP) {
chomp;
if (/alias=/) {
$_ .= " xxxxxxxx.$site";
}
$info .= "&$_";
}
system("fetch -qo - \"http://localhost/manager/ispmgr?out=text&func=site.edit&sok=yes$info\"");
}