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.

Cannot access second MSM site after first is made live

March 05, 2012 11:50am

Subscribe [3]
  • #1 / Mar 05, 2012 11:50am

    Chris Arnold

    201 posts

    We have 2 sites, EE MSM 2.4, and one was made live last week. Domain pointed to the new host, etc, and we’re off without a problem. However, the second site (which lives as a subdomain) is still offline being completed.

    We noticed that logging into the CP and trying to view the second site now does not allow us to view it—we get the offline template as if we aren’t logged in. Certainly this has to do with changes after making “domain1” live. The second site is set to offline. When turned on, we CAN see it at the site url. When it’s off, though, we cannot. Generalized setup is as follows:

    [domain1]
    —-
    admin.php and index.php
    $system_path = ‘./adm’;

    [domain2]
    —-
    index.php (no admin.php - same login location ok)
    $system_path = ‘../www/adm/’;
    $assign_to_config[‘site_name’]  = ‘domain2’;
    $assign_to_config[‘cp_url’] = ‘http://www.domain1.com/adm/’;
    $assign_to_config[‘site_url’] = ‘http://domain2.domain1.host.com’; 

    (dev url above prior to adjusting to domain path ... this works only when the site is set to online)

    Missing something obvious? Haven’t had this setup before.

  • #2 / Mar 05, 2012 3:19pm

    Chris Arnold

    201 posts

    Have the client making updates in the site blindly at the moment, but would love to hear ideas on updating this to a workable status. Thanks!

  • #3 / Mar 06, 2012 11:20am

    Chris Arnold

    201 posts

    Keeping this above page 3 ... thanks in advance.

  • #4 / Mar 06, 2012 4:11pm

    Chris Arnold

    201 posts

    For now I’m reverting the CP Login URL to the dev site so the two sites don’t collide on knowing what domain a user is logged in to. If there is a better way, please let me know. Unfortunately, we couldn’t wait any longer for tech support at this point. Thanks.

  • #5 / Mar 06, 2012 5:13pm

    Dan Decker

    7338 posts

    Hi Chris,

    I apologize for the delay in response. We do our best to answer each new issue within 48hrs.

    Keeping this above page 3 ... thanks in advance.

    Never fret about that! We have a completely separate means of managing the forum requests, you won’t go unnoticed 😊

    From a technical standpoint, you have everything setup properly. The issue is:

    domain2.domain1.host.com

    Unless you set explicit cookie values for each site in the respective Control Panel, that “sub-sub-domain” won’t work. Without explicit cookies, EE will only set a cookie for the primary domain, and MSM can’t detect that you are logged in.

    To work around this, you can set cookie values for each site, or you can go ahead an configure MSM with the real domain.

    For cookies, go to Admin->Security and Privacy->Cookie Settings

    What versions of ExpressionEngine and MSM are you using?

    Cheers,

  • #6 / Mar 06, 2012 6:36pm

    Chris Arnold

    201 posts

    domain1 site Cookie Domain is set to .domain1.com
    domain2 site Cookie Domain is set to .host.com

    Are you referring to something else? Can’t configure to the real domain yet since we haven’t pointed it yet (old site in place now).

  • #7 / Mar 07, 2012 12:16pm

    Chris Arnold

    201 posts

    Unless you set explicit cookie values for each site in the respective Control Panel, that “sub-sub-domain” won’t work. Without explicit cookies, EE will only set a cookie for the primary domain, and MSM can’t detect that you are logged in.

    Trying to nail this down. Can you explain this in relation to the current setup / cookie settings?

    - Domain1 is site1 and now live
    - Domain2 is the second site, not yet live, and still running from the dev URL as a subdomain.
    - Can manage both sites, but cannot “see” Domain2 since it is still offline
    - Offline template triggered for Domain2 from the Domain1 login location

  • #8 / Mar 08, 2012 3:14pm

    Chris Arnold

    201 posts

    Hi Dan, we’re in limbo a bit here with the client not being able to view the second site. And again, the way around that at the moment is to revert to the temp hosting dev domain for the CP. Either aren’t ideal. Any chance you can provide next steps today? Thanks!

  • #9 / Mar 08, 2012 4:42pm

    Dan Decker

    7338 posts

    Hi Chris,

    Sorry for the delay. For site 2, the cookie domain needs to be fully qualified, so:

    .domain2.domain1.host.com

    Based on your example in the first post.

    - Offline template triggered for Domain2 from the Domain1 login location

    Can you broaden your explanation here? Do you have the offline.html file in this site’s root? If you login to domain1, you are redirected to domain2’s offline file?

    Cheers,

  • #10 / Mar 08, 2012 5:17pm

    Chris Arnold

    201 posts

    Hi Dan - both cookies seem correct.

    The online site, Domain1, is: .domain1.com
    The offline site, Domain2 (a subdomain on the same host), I have tried all:

    .domain2.domain1.host.com
    .domain1.host.com
    .host.com

    I have two offline templates. We are seeing the domain2 offline template (at least that makes sense). To confirm, if I login to domain1, which we do, yes, the domain2 offline file shows when trying to modify and edit that site which is not yet live.

    I’ll gladly provide login credentials if it means a quicker resolution.

  • #11 / Mar 09, 2012 4:24pm

    Chris Arnold

    201 posts

    What’s the best way to proceed with stomping out this quirk? I’m very interested to see what resolves the issue. Thanks, Dan!

  • #12 / Mar 09, 2012 5:35pm

    Shane Eckert

    7174 posts

    Hello Chris Arnold,

    This seems related to this bug. It might not be, but just to rule it out, you might take a look at it.

    Let me know what you think.

    Cheers,

  • #13 / Mar 09, 2012 6:05pm

    Chris Arnold

    201 posts

    Thanks Shane. Our version of the sites.php file already has that code fix in place.

  • #14 / Mar 11, 2012 8:08pm

    Robin Sowell

    13255 posts

    I THINK this is the problem- site1 (live) and site2 have different domains, yes?  You can edit both by logging into site1/admin.php or what have you.  But when you do that?  If site2 frontend is on a different domain when you try to access it- it will not see you as logged in.  PHP can only set cookies for the domain you are currently on. 

    SO- one option would be to access site2 via site2.site1.com - with cookie domain set to ‘.site1’.  Another option would be to put an admin.php file in the site2 subdomain and login to that backend (with cookie domain for site2)- at which point the site2 frontend will see you logged in when you go to it.  And a slightly clunkier third option is to set all of the template access preferences to redirect to a template with a login tag on it so they can actually login to the frontend (would still need a correct cookie domain- but .domain.com would be fine).

    Does that help at all?  We may be confusing ourselves with our examples, so if this doesn’t clarify we may need to drop you an email with some details on how we can get more concrete.

    But it boils down to- logging into site1.com/admin.php is not setting cookies for site2.host.com and thus going there you are not seen as logged in.  And currently there isn’t a way to login on the actual domain you need the cookies set for.  I think.

  • #15 / Mar 12, 2012 11:45am

    Chris Arnold

    201 posts

    Robin, this all sounds about right. So when it comes time to set domain2 live, there will still be no way to have them login to domain1 and see changes to domain2… technically? I suppose that will *kind of* work seeing as domain2 will be live and therefore the offline template won’t show, but if they ever took domain2 offline to make changes, we’d be right back here.

    It sounds like what you’re saying is with MSM, there isn’t a way to have a single login location for multiple sites (e.g. sister sites on different domains) to manage both even if they’re on the same host. It CAN be done, but like I said, if a frontend site from a domain other than the logged-in one won’t work.

    Basically:
    domain1 logged in, domain2 not seen when offline (since different domain / php cookie issue)
    domain 1 logged in, domain2 seen when online (even though different domains, since it’s “live”)

    Is that right? The same login can only work if the sites are on the same domain… I think.
    If I’m correct, I’m thinking the docs that say

    Tip: In some multi-site situations, you may not want to allow Control Panel access from anyhere other than domain1. This file can be removed in those cases.

    might be a little misleading if it’s not possible when new sites are not on the same domain.
    Or, correct me if I’m wrong there.

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

ExpressionEngine News!

#eecms, #events, #releases