CodeIgniter Forums

Full Version: Codeignitor Multidomain accessing Single Instance of System AND application folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]ZeusChicago[/eluser]
Howdy!

I had a quick question that after hours of google'ing and searching, and plain out just trying it I could not figure out myself.

I am currently attempting to get multiple(x number of) domains to run off a single system AND application folder. First let me layout what we currently have that works just fine, but has one two side-effects that we are trying to get rid of.

We currently have this implemented in the following manor
OurMainDomain.com
clientx.ourmaindomain.com <-- then parking clientx.com domain onto that
clienty.ourmaindomain.com <-- then parking clienty.com domain onto that
clientz.ourmaindomain.com <-- then parking cliextz.com domain onto that

This setup gives us the apache directory layout of
/home/ourmaind/public_html
/home/ourmaind/public_html/clientx
/home/ourmaind/public_html/clienty
/home/ourmaind/public_html/clientz

We then setup CodeIgnitor in
/home/ourmaind/system
/home/ourmaind/system/application

There is an index.php / .htaccess in each of the
/home/ourmaind/public_html/clientx folder

Then for each client, we have a
/home/ourmaind/system/application/views/home/clientx
/home/ourmaind/system/application/views/home/clienty
/home/ourmaind/system/application/views/home/clientz

These folders contain a unique "home page" view for each of our clients, as well as any custom graphics, css, flash, javascript, etc.

What this allows us to do, currently is have a base system of "views", "controlers", "models" across all our customer sites that function 100% the same across the board, and allows us to customize a "home page" for each client, while keeping the rest of the websites look and feel for any other page in the /views 100% identical (except for what we change in the css)


This system has worked GREAT for what we were doing, until the point now where we are adding our 300th customer, and running on 4 different web servers. We have domain account on each server, each with X number of clients on each server, running one copy of CI and our application folder. As the number of web servers grow, maintaining x copy's of the application folder and keeping them in sync is getting harder and harder. What we want to do is the following


WebServer1
clientxcdomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application
clientydomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application
clientzdomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application

webserver2
clientacdomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application
clientbdomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application
clientcdomain.com
index.php,.htaccess,assets folder with custom home page,css,flash,javascript,etc
symlink -> NFS File Share with /system/ & /system/application

NFS File Share
/system and /system/application

So I setup a NFS export on highly available server thats clustered and redudant

I export a /system folder that contained our application folder

I setup each webserver to mount this NFS share at boot time

I created a symlink in each of our clients /home/clientx/ (which is their wwwroot) called shared that points to the NFS mount

I configured the index.php to point the symlink/system and /symlink/system/application folder

I tweeked the config.php to set the real url of the site based on $_SERVER['http_host'] and a couple other settings unique site.

At this point I believe i am stuck at a permissions issue with the NFS share. Code Ignitor does load! but it loads a blank page Sad I've walked through all the "code ignitor blank page" threads here and I dont think thats my issue.

Anybody that has a similar setup have any suggestions. Or anybody that has their CI install running off a NFS share know what permissions (and who needs to "own" the files) for it to work, I would be most appricitive.

Thanks in advance!

Zeus

P.s The two side-effects were trying to get rid of.
A.) I dont want to maintain X number of copies of the system/applications folders, just 1

B.) At some point were going to have to move to a clustered/load balanced environment in which all the servers will be identical thus having the same system/application folder for one account that handles all the domains. Having a single system/application folder will be key for this to occur