views:

203

answers:

5

I need to develop a project that would allow me to instance many copies of a website, but each copy needs to be a separate website. I could upload the same code to many different accounts, but I would prefer to have only one copy of the code. Each website would be an "instance", so to speak. This way I could upload the code once and update all the websites at the same time.

For technical reasons I need to use PHP (but I'm interested in the other options too, for my own knowledge), and I thought Jelix could be a good choice of framework. Are there better options out there?

+3  A: 

You can have all code in one directory, and then create virtual subdirectories in all your web sites, which all point to this directory. This is how Microsoft solves the problem in SharePoint.

erikkallen
+1  A: 

The easiest bet is to have all the websites link to one server (perhaps distributed).

Pass the calling URL through your webserver to generate configuration information. Use those passed URLs to define the differences between each site.

Beyond that, the framework is almost immaterial to the question, so I'll leave it to someone else to answer.

Just remember, if you make 20 copies of the same code, that's 20x the time it'll take to fix bugs.

+1  A: 

If you're using UNIX or Linux for a web server, you could create one master copy of the PHP code, and then use symbolic links to the actual files that are in separate directories with virtual websites set up in Apache. You could also put site-specific config files under those directories, but the bulk of the PHP code would be resolved as symbolic links to the "master" code.

m0j0
A: 

I'm not sure what kind of websites you're talking about, but why not use an already developed application like Wordpress or any other cms? The code is identical on every website, and you can easily update it. The website-specific data is only present in the single configuration file, and the MySQL database.

Dave
A: 

Thanks for the answers. That's pretty much what I thought. As to why not use an already developed CMS, it's because the requirements are so 'custom' that it's better to build it from scratch.

Whistle