Page 1 of 1

Website Hosting / Website creation

Posted: Tue Feb 19, 2008 2:51 am
by ed209
I run a multi user site that has the usual profile page with bio, picture etc. Each user also has a series of profile pages where they have their photo gallery etc. I want to offer that through their own domain - but still controlled through the main multi user site control panel.

Here are my thoughts so far.

- On domain registration through a domain name reseller account (like fasthosts.com - any recommendations?) call an API on my site to create a directory on my server e.g.
/home/useraccount/public_html/thesite

- store that path against the user in question

- In their control panel, they can choose a HTML/CSS template for the site then they could click an "update" or "render" button which would store a cached version / html of their site to the above path. That's the version that a visitor to the domain name would see.

Does that sound like a good method? My only concern is that some features on the main site write to the DB like rating a photo or adding someone as a friend. It would be nice to offer this through the user websites too. Is the only sensible way of doing this to create a set of APIs for my main site and use AJAX to offer that?

Any thoughts welcome!

Re: Website Hosting / Website creation

Posted: Tue Feb 19, 2008 12:26 pm
by Christopher
That sounds like a reasonable plan. How would you handle multiple servers?

Re: Website Hosting / Website creation

Posted: Wed Feb 20, 2008 3:15 am
by ed209
I have no idea! I'm not really a sys admin...

My original plan was to do it via FTP, but the way I mentioned in my original post is simpler for now. I could probably get 100's of sites on my current server by which time I'll have enough cash to get someone else to worry about scaling :crazy:

But first thing's first, I need to get a working version. I think a sensible place to start is to build an API, is there a standard for doing this?

Re: Website Hosting / Website creation

Posted: Wed Feb 20, 2008 4:03 am
by alex.barylski
Not clear exactly what it is your trying to do...

You could use a shared host to power your web site builder and just FTP HTML files onto a remote server. If some of those web sites had PHP scripts as well, which conneted to MySQL, etc...you would need MySQL installed locally or they would need to connect to a remote MySQL source - no API needed this is handled by the MySQL API already.

If you wanted to store data on your primary server in a format which is not readily available and doesn't already have an API which supports some kind of protocol...then you would use something like SOAP or REST for the API.

One word of caution. If you upload to third party unrestricted, shared hosting accounts...having your PHP script web sites connect to your central MySQL server...you would essentially be opening that server to the world because of the poor security measures most shared hosting companies practice. It would likely be a trivial matter for someone to get your MySQL user/pass credentials and do whatever that account allowed - which is usually a lot!

Re: Website Hosting / Website creation

Posted: Wed Feb 20, 2008 4:51 am
by ed209
thanks for the reply. At the moment, I plan on generating a HTML version of the site - i.e no PHP. This HTML site would consist of something like:

home page / biog
Artworks
artwork 1
artwork 2
artwork n
CV page
Blog posts page
contact page

all of that data for each user currently sits on a central site / database(s). Users log in to that central site to add artwork, photos, blog posts etc.

I want to take that data, render it into some HTML templates (I already use Flexy template engine on the site anyway) save it under that domain. Using a domain reseller API, users can register a domain name, which will trigger my server to create a "hosting account" where those HTML pages will be stored.

That part is reasonably straight forward, but now I want to inject some interactivity back into that flat HTML site and enable visitors to those satellite sites to leave comments, send messages (through internal messaging system) etc - I believe the only way of doing this is to use AJAX + build an API for the mother site?

From what I understand in your post, I could include a PHP file along with that HTML and use SOAP instead of building an API? That PHP file woundn't need DB details would it?

Re: Website Hosting / Website creation

Posted: Wed Feb 20, 2008 6:08 pm
by alex.barylski
Your stepping on the toes of my very own business...so I cannot disclose any more details and thus choose to remain silent inorder not to inciminate myself. :P

Just kidding. You want to add dynamic modules to each satellite site (cool terms BTW I'm gonna borrow that) by either using AJAX - which isn't search engine friendly or you store the modules as PHP code on each satellite server. The latter gets complicated quickly when you wish to allow users to have total control of the HTML page all the while giving the dyanamic plugin modules, like news feeds, property listings, etc.

You don't need an API for either really. You can invoke any plain jane URL using AJAX - return results as XML or JSON or other and render on the satellite site via JavaScript and it's DOM.

Personally I hate relying on JavaScript...I do most of everyting on the server for consistency. I would keep each modules installed locally and setup a database - which requires the remote servers to support mySQL. Not a big requirements once people are convinced they need that extra module.