XILO Community Forum

Support 0845 034 6444 • Sales 0800 084 2421

Go Back   XILO Community Forum > Customer Support > Support Queries > Programatically create subdomains
Support Queries This forum should be used to contact XILO's support team should you have any problems with your account.

Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Junior Member
chuntuk is on a distinguished road
 
Posts: 6
Join Date: Dec 2005
Location: Leicester, UK
Default Programatically create subdomains - 24/06/2006, 10:53 AM

Is it possible for me to write a perl script that will create subdomains of one of my domains (not one I'm currently hosting here, but one that I'm hoping to move). Alternatively, is it possible to use mod_rewrite to redirect all instances of foobar.domain.co.uk to www.domain.co.uk/cgi-bin/script?domain=foobar ?

I know that the latter apporach is technically feasible, but it needs to be put in the main Apache config file rather than my own .htaccess file, is that something you'd be willing to do? Do you have another approach to suggest?

PS. The site in question is www.yhagroup.org.uk - the idea being that as new groups are added to the system, a subdomain is automatically created at groupname.yhagroup.org.uk . It's easy at the current host, as I only have to create a directory in the right place to make a subdomain, but I want to move over to Xilo if possible.
Reply With Quote
  (#2 (permalink)) Old
XILO Staff
Matt is on a distinguished road
 
Matt's Avatar
 
Posts: 690
Join Date: Nov 2005
Default Re: Programatically create subdomains - 24/06/2006, 10:57 AM

Chris,

It's not something that can be done. Although we could add what is needed to Apache - everytime you make a change in cPanel/H-Sphere, it would overwrite the manual change made.

However, that said (just thinking about it) - it maybe possible to do this via way of static IP because then no matter what you point at the IP (*.domain.co.uk) it will show the same content - You'd then have to code something to look at the URL requested and rewrite that to the content you want.

Matt


XILO Communications Ltd.
Internet Hosting and Online Services
w: http://www.xilo.net/
h:
http://my.xilo.net/
t: +44 (0) 845 034 6444
f: +44 (0) 845 034 6555
Reply With Quote
  (#3 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 769
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Programatically create subdomains - 24/06/2006, 11:26 AM

If you had a reseller account with WHM then you could do it using the WHM API and a perl/php script.
Reply With Quote
  (#4 (permalink)) Old
Junior Member
chuntuk is on a distinguished road
 
Posts: 6
Join Date: Dec 2005
Location: Leicester, UK
Default Re: Programatically create subdomains - 24/06/2006, 12:24 PM

I do have a reseller account, but the site in question would be hosted on one of it's resold accounts rather than the main one. Still, I suppose I could write a script on the main account that the other one would call. Where would I find some documentation on that API? I'm not getting any joy from Google.

That static IP method sounds a bit scary, if I understand it correctly - it sounds like I'd have to write my own web server, but maybe I'm getting the wrong end of the stick. Still, it's another option to explore
Reply With Quote
  (#5 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 769
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Programatically create subdomains - 24/06/2006, 12:33 PM

All you need is an account that permits access to WHM. One because that has the API and two because that is the only place you can add subdomains using any kind of script.

What you would need to do is write the script to tooth into the API and host it on your main reseller account, using the security key (generatable in WHM) as authentication.

Then you would need to pass this script the subdomain you wished to add using your own script on the resold site you speak of.

Documentation on how the API actually works is a little sketchy, however there is a wealth of information available over in the FAQ, Support and Forum sections of CPanel's website http://cpanel.net where you should be able to find answers and help on the subject.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting non-existent subdomains solaris Support Queries 1 17/10/2006 5:03 PM


Powered by vBulletin | XHTML | © Copyright 2003-2008 XILO Communications Ltd. All rights reserved. E&OE