This may be a server question, but I’m asking how to do this system in PHP before you vote to close as off-topic.
I’m setting up a custom cloning site system, where paid users can have their own software but on a custom subdomain build, e.g. user1.domain.com. I want to allow them to have their own paid domain pointing to my server replacing their built subdomain. However, I don’t know how to do this kind of process in raw PHP.
For example, on an administration page, they can input their paid domain and I want the domain to be added to BIND DNS/nginx on my server, but I need to know what I need take from there (except URL validation) such as checking if the domain is pointing my server when they enter the nameservers of my server from their domain manager (GoDaddy, 123-reg, etc) and so on and making sure the domain is properly active and can be taken well when accessing the new domain that replaces the built domain (nginx can do this?)
What steps should I take into making this kind of system? Is there any server support I need to take into such as cron jobs or such.
My server is running Ubuntu 11.10 with nginx 1.0.6.
EDIT: I already have a wildcard A record in BIND.
Just point
*.domain.comto your server. Assuming you are running Apache, you just define yourVirtualDocumentRootinhttpd.confand you’re off and running. Nothing to do in PHP or anything else.Check out the documentation here: http://httpd.apache.org/docs/2.0/vhosts/mass.html
UPDATED
Didn’t catch you were using nginx, sorry about that – looks very similar to Apache:
in your
server {config. http://wiki.nginx.org/VirtualHostExampleEdit your configuration file (nginx.conf) and change the
serversection beneathhttpas shown in the VirtualHostExample at the link above, replacing the server name and paths with your server’s info.