Is there a guide to create an automated web creation site?

I wish to develop a site where customers can log sign up and create their own site with either a subdomain off mine or their own domain name. I guess something like worpdress.com or weebly.com etc. Can someone help with a template or preocess to set this up? Thanks