Page 1 of 1

Bash scripting w/ php exec [UPDATED]

Posted: Sat Jul 14, 2007 9:50 pm
by kaYak
I have a dedicated server setup with mod_rewrite to handle dynamically created sites for clients. I have mod_rewrite setup so that any domain that is parked on our domain will be sent with mod_rewrite to a script that handles the address and returns a dynamically generated site based on that.

What I would like to do now is allow users to use their own domain names without us manually having to setup a parked domain name. We have cPanel running.

I'd like it if we could have a wildcard DNS zone file instead of having to have a different zone file for every customer's domain that we add. Is it possible to do this? I would need any domain that is pointed to a certain nameserver to be invisibled directed to the domain that we are hosting all of the sites on.

This works fine right now for subdomains as well as parked domains. The wildcard system works nicely and easily for subdomains but I'd like it for domains as well.

I believe the sole problem is the DNS. I was able to set the default document root to our server so that it handles all domains without having to have DNS setup for each individual one, although there is nameserver resolution problems here where online services don't like the site and can't handle it for whatever reason. If someone could offer a possible solution I'd appreciate it.

EDIT: I'd like to do this how WordPress.com does it so that the customer can just change their nameservers and our site responds automatically. I suppose this is called domain mapping.

Thanks,
Kyle

Posted: Mon Jul 16, 2007 8:49 am
by kaYak
And this is the reply I get from the host:
This is not possible as pointing to your name servers does not accomplish anything if there is no DNS zone for that domain.
So, I suppose I'm looking at creating a PHP or PHP/Shell combo script to create these DNS zones on the fly. I will have to see if they have the appropriate permissions to do so.

EDIT: Can anyone tell me where I can get started with bash scripting to the point that I can create and delete a file and pass php variables to the script in some manner?

Posted: Tue Jul 17, 2007 5:14 pm
by kaYak
EDIT: For the most part it is solved. I'm just working on having the script be able to reload named.

For some reason the named reload keeps failing but from the ssh line it works fine.