I detailed how I do it in an article in the Bakery:
http://bakery.cakephp.org/articles/view/one-core-one-app-multiple-domains

It works on one Cake core, one app, one apache (or nginx) vhost (with
multiple aliases). It makes development-specific settings easy as-well
since that is handled the same way. The local domain "martin.site"
gets the same level of separation as all the rest.

It works and has worked since 2006 in various iterations. It does
require a minimal alteration to one Cake core file to make caching and
logging domain-specific.

In reality I maintain two app directories. One stable and one edge or
testing. Each has it's own vhost and I can more sites from stable to
testing and back by just moving the single line with the domain name
from one vhost to the other.



On Aug 27, 6:02 am, Sebastian <sebastian.von.con...@gmail.com> wrote:
> The title may be misleading, but bear with me.
>
> I would like to use CakePHP to create one application, which then has
> multiple instances. Think of it, if you will, as different websites
> being powered by the same application--not a copy of it. Each instance
> (website) would have its own database and website-specific files and
> configurations, but they all load the same CakePHP application to
> power it.
>
> The basic idea as I have it is to have different directories, each
> containing a .php file with configuration options, which then loads
> the application from another directory. Something like this:
>
> /mysite
> /myothersite
> /anothersite
> /app
>
> ...where the first three directories contain the single .php file,
> images and possibly a cache, and the app holds the application.
>
> The reason I want to do this is because of it being easier to maintain
> one installation per server than having 10 or 20 or 50 separate
> installations of the same application. Upgrading would be infinitely
> easier. It might even be faster and take less resources from the
> server.
>
> For the record, I'm somewhat new to CakePHP. I'm an experience PHP
> developer who also have extensive Rails background, so while I'm new
> to Cake, I'm not new to PHP or the MVC architecture.
>
> My question is whether this is a viable approach. Is using one CakePHP
> app with different databases going to screw up caching? Can I disable
> the caching and build my own caching system in the individual
> directories? Is it going to make things slower than if I had
> individual CakePHP apps for all of the websites? How would the single
> application handle, say, 50 websites?
>
> Basically, I'm looking for thoughts and ideas on whether the single
> installation of the application with X number of websites is a better
> approach than the X number of individual installations.
>
> Any help would be appreciated.
>
> - Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to