2

OK, first question on SE so bear with me. I'm trying to setup an older site (after going through the EE2 upgrade process) on a virtual private server the client has running WHM and cPanel. The sites have been running for quite a while, including ecommerce and as such each site/domain has their own cPanel for managing unique SSL's (and thus unique IP addresses). In this case then, I'm not really in a position to change the setup for the server's directory structure and I'm attempting to get this setup from that point of view.

Ref: https://github.com/focuslabllc/ee-master-config/issues/12#issuecomment-11874743

/home/account1
    /_templates
        /default_site
    /config
    /public_html
        index.php
        admin.php
    /system
    /third_party
/home/account2
    /_templates
        /site2
    /public_html
        index.php
        admin.php
/home/account3
    /_templates
        /site3
    /public_html
        index.php
        admin.php

Now I have checked out the referenced GIST (https://gist.github.com/d27570a3e52bdf656f54) for trying to make Focus Lab Config work with MSM, with mixed results, but my main concern comes down to the fact that the paths are being set based on the URL being accessed. This is all fine and good if you're accessing the website from the front end using it's assigned URL, but if you use the site switcher within the EE control panel, it all falls apart.

e.g. I log into the default sites admin (http://site1.com/admin.php). All path references for template directories, upload preferences, system assets are correct for that site. Now if I switch to site2, my URL still begins with 'site1.com' so any uploads while editing site2 from the same URL will result in the incorrect paths being used.

So this is essentially where I'm at, and wondering if smarter heads here can assist in getting a final solution. My thinking at this stage, is that I need to be able to set a variable for the main server directory (in my case above it might be '/home/' which could be derived from the location of '$_SERVER['DOCUMENT_ROOT']'. The next is the ability to assign an account directory for each of the sites in the MSM (exp_sites) that can then be set as a conditional on the config depending on which site is being viewed within any or all of the possible EE control panels that could be logged into. I'm not sure if the config.master.php is reloaded each time a page is refreshed.

And there you have it. A problem without a solution and not enough expertise in my own head to solve. Any and all help would be appreciated.

Regards Brendan

BTW, in the config.php and database.php files, I updated the reference to the config master using 'APPPATH' rather than '$_SERVER['DOCUMENT_ROOT']'.

/**
 * Require the Focus Lab, LLC Master Config file
 */
require APPPATH . '/../../config/config.master.php';
1

This isn't going to be much help but i ended up hard coding paths in after hitting multiple problems. MSM seems very tricky to set up like this, pity.

| improve this answer | |
  • For the time being, I have done that also, but under that guise, should anyone use the site switcher in the EE CP, there's a good chance something isn't going to work correctly. – Brendan Underwood Jan 31 '13 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.