ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM Newbie

June 08, 2012 4:50pm

Subscribe [1]
  • #1 / Jun 08, 2012 4:50pm

    wbdzynr

    137 posts

    Using MSM for the first time on a project (and have another one right around the corner) and I have some questions regarding best practices.

    - The user guide references two settings to update “at a minimum” at the end of the “Create a New Site”.  What other settings are suggested and/or recommended?

    - I like to save templates as files.  I did that for my new site, and they are saving properly.  However, the default site has an .htaccess file as well as an index.html file.  Should I copy those to the template folder for my other MSM sites?

    - I probably won’t allow access to the CP from anywhere but the default site.  So I’m only going to have an index.php file in the root.  That means there isn’t much in the second site.  My primary site has a folder structure like this:

    /assets
    - css
    - js
    - images
    - ...

    I would assume I would create a similar structure for the non-default sites so they reference their files in a similar fashion?

    I guess I’m just not sure what should be in the default site folder and what should be in the non-default site folders.  Maybe I’m over thinking things!

    Any tips or suggestions would be greatly appreciated.  Thanks!

    Todd

     

  • #2 / Jun 10, 2012 8:33pm

    wbdzynr

    137 posts

    OK, been pushing forward again today - some success, some failure.

    I was trying to upload files from Site 2.  When I go to publish/edit, I see a message about “Crossdomain” where I am to upload an image or file.  I finally changed the file upload preferences “URL of upload directory” and “Server Path to Upload Directory” to that of the default site.  I didn’t get the message any more, and I was able to “upload” without any issues (prior to that it would just spin and not finish).  However, while it appears to work in the control panel, the file doesn’t actually upload.

    So I’m kind of at a loss on what I should be doing.

  • #3 / Jun 11, 2012 11:05am

    wbdzynr

    137 posts

    Does anyone have any thoughts here?  I’m about ready to just do a new install for Site 2.  However, it’s silly to do.  While it would fix the issues I’m having now, it would cause some new ones regarding content that has to be duplicated each time.

  • #4 / Jun 11, 2012 11:17am

    Dan Decker

    7338 posts

    Hi wbdzynr,

    Sorry for your delay over the weekend. Let’s see if we can get you up-to-speed on MSM!

    Here is a basic file set from a working MSM install:

    //CONFIG//
    $config['cp_url'] = "http://engine.dev/admin.php";
    $config['doc_url'] = "http://ellislab.com/expressionengine/user-guide/";
    $config['is_system_on'] = "y";
    $config['allow_extensions'] = "y";
    $config['site_label'] = "Test 23";
    $config['cookie_prefix'] = "";
    $config['multiple_sites_enabled'] = "y";
    
    index.php and admin.php site 1
    NO CHANGES
    
    index.php and admin.php site 2
    $system_path = '../system';
    /*---------------------------*/
    $assign_to_config['site_name']  = 'msm_test';
    $assign_to_config['cp_url'] = 'http://msm.dev/admin.php';
    $assign_to_config['site_url'] = 'http://msm.dev';
    
    --- admin ---
    $system_path = '../system';
    /*---------------------------*/
    $assign_to_config['site_name']  = 'msm_test';
    $assign_to_config['cp_url'] = 'http://msm.dev/admin.php';

    Since you are not using site 2’s admin.php, you can ignore that bit.

    Your upload destinations and file based assets for site 2 can all be kept under the root of site 2, with the proper permissions set. Any cross-domain conflicts could be cleared up by your host.

    Templates-as-files for the second site can be stored in the same path as the original site, if you want. You should see a path similar to /system/expressionengine/templates/second_site

    The only URLs and paths that must remain the same for each site are the URL and path to /themes

    I hope this helps clarify a little more about MSM.

    I look forward to your reply!

    Cheers,

  • #5 / Jun 11, 2012 11:44am

    wbdzynr

    137 posts

    Hi Dan - Thanks for the response - and I understand about the weekend delay. 

    In your fantastic example above, can you confirm/clarify a few things?  First, let’s assume that Site 1 is the primary site and and Site 2 is the additional site.  I apologize for being redundant on some of what you wrote, but I’m hoping that it will help point out any errors in doing so.
    - Nothing changes with how Site 1 index.php and admin.php are configured.
    - Site 2, I need to change the system_path to that of Site 1.  In my case, I have my sites set up like this:
    Site1.com/public_html/...
    Site2.com/public_html/...
    So, in my Site 2 index.php, my system_path looks like this:  ‘../../Site1.com/public_html/system’

    Site 2 pulls up just fine, so I’m assuming these settings and setup are ok?  Or is Site2 supposed to be a sub-folder under Site1?  I currently have my templates-as-files saved as Site2.com/public_html/files/templates and my CSS/JS saved as Site2.com/public_html/files/css (and js).  Again, everything is working ok with display but perhaps this is the problem.

    - for the MSM settings for Site 2, this is what I have:
    $assign_to_config[‘site_name’]  = ‘Site2’;
    $assign_to_config[‘cp_url’] = ‘http://Site1.com/admin.php’;
    $assign_to_config[‘site_url’] = ‘http://Site2.com’;

    Are those correct?  If it’s better/easier, I can set up the admin.php for Site 2. 

    In the control panel, under Admin -> General Configuration, I have the following:
    URL to the root directory of your site:  Site2.com
    URL to your “themes” folder:  Site1.com/themes/
    Themes Folder Path:  /Site1.com/public_html/themes/

    Does that look correct?

    For Site 2, my file uploads paths are those of Site 1.  When I did this, I got the “Crossdomain” warning on anything that needed to be uploaded, and attempting to upload just kept trying and trying.  If I changed the path to that of a folder on Site 2, it “worked”, but didn’t actually upload anything.  If I set that all up so that Site 1’s assets are under Site 1, and Site 2’s uploa

    I ran a “php_info.php” file on my server, and confirmed the server paths.  I also show that “safe_mode” is OFF and open_basedir is “no value”.

    Does anything there stick out as an issue?

    Thanks again!

    Todd

  • #6 / Jun 12, 2012 4:45pm

    wbdzynr

    137 posts

    OK, one more try here…..

    I changed my set up so that my second site resides in a folder under the primary site.  So the structure looks like this:

    Site 1
    - files
    - images
    - system
    - site2
      - index.php
      - admin.php
      - .htaccess (which is empty)
    - index.php
    - admin.php
    - .htaccess (which is set up to remove the index.php)

    I configured Site 2 as an alias of my primary site.  I checked and rechecked all of my paths based on teh documentation, as well as a few other sites. 

    When I go to Site1.com, that site pulls up correctly and displays site1.com in the browser address bar. However, when I try to pull up Site2.com, it pulls up the primary site, but displays site2.com in the browser address bar. If I go to site1.com/site2, then it pulls up the site files ok.  However, that’s not really acceptable.

    I’ve dug and dug, and perhaps in staring at everything for so long, I’ve missed something obvious.  But the client doesn’t care!  :(

    Todd

     

  • #7 / Jun 13, 2012 3:12pm

    Dan Decker

    7338 posts

    Hey Todd,

    Your walk through is generally in order - 1 thing stands out to me:

    URL to the root directory of your site:  Site2.com

    Make sure that includes the http:// and the trailing slash, those are pretty crucial.

    Themes Folder Path:  /Site1.com/public_html/themes/

    That should be the full server path to themes. With that, it’s trying to pull from a folder at the root of site 2 that does not exits.

    What version of ExpressionEngine and MSM are you using?

    I’m subscribing to this so I’m sure to get your updates!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases