Planning a site that lets users create their own site. Help!

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
ChrisF79
Forum Commoner
Posts: 26
Joined: Tue Apr 01, 2008 8:26 pm

Planning a site that lets users create their own site. Help!

Post by ChrisF79 »

I'd like to create a site that allows photographers to create their own site with their own domain. They join my site, sign up, choose a template, edit their text, upload photos and they have their own site at http://theirdomain.com. Simple concept but here's my question to get the conversation started:

My main site holds the templates. When a visitor goes to theirsite.com, how do I reference back to my site to return the template, content, photos, etc?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Planning a site that lets users create their own site. H

Post by requinix »

Either
a) You sell them the things to make their site, they copy it to their site, and you're done with it. You're basically providing something like WordPress.
b) Their site runs on your machines. Their domain points to your machines. They own the domain name (or possibly not) but you host their website.
ChrisF79
Forum Commoner
Posts: 26
Joined: Tue Apr 01, 2008 8:26 pm

Re: Planning a site that lets users create their own site. H

Post by ChrisF79 »

Right, option B is exactly what I'm going for. I want it to be completely automated. That's where I'm hung up. Can you give me the gist of what it takes to have that happen? So we have mydomain.com where they sign up, choose a template, etc. They point their nameserver to my dns1.mydomain.com as an example. Then what?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Planning a site that lets users create their own site. H

Post by requinix »

Set up Apache so that there's only one website configured. When people go to visit the site Apache will pick it up and, lacking a specific website for that name, it'll use the default website. The same code executes for everybody but it uses the hostname to decide specifics (ie, which templates to use).
Another method is to actually have a new VirtualHost for each site, then reload Apache when there are new sites. I don't know how well that performs. You'd still point them all to the same code though.
Post Reply