We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51838
    • 8 Posts
    Hi,

    I'm a MODX-newbie and pretty impressed so far. Unlike Joomla, this cms seems completely uncluttered & fully costumizable, which is perfect!

    However, I do have some trouble with my sub-domain setup (see https://rtfm.modx.com/revolution/2.x/administering-your-site/contexts/creating-a-subdomain-from-a-folder-using-virtual-hosts:

    • 1 modx installation in root
    • 1 main domain context (web) + 1 published resource
    • 2 sub domain contexts + 1 published resource each
    • system settings: site_status (no) / friendly_urls (yes)
    • context settings: site_start/site_url/http_host/base_url
    • 3 edited files for each (sub)domain: .htaccess/index.php/config.core.php

    It all works fine - as long as my site is online - but when I want to view one of my sub domain pages while my site is offline, I get the message "site temp unavailable" - like as if I was a normal user instead of being recognized as super user. Viewing a resource in the "web" context, is no problem at all.

    I played around with session_cookie_domain (see https://forums.modx.com/thread/?thread=31157&page=1), but doing this, disables access to my MODX Manager completely.

    I also played around with access control/permission, but no luck so far.

    What am I missing here?

    Thanks for the help! [ed. note: bohobravo last edited this post 8 years, 2 months ago.]
      • 44665
      • 60 Posts
      sebastian-marinescu Reply #2, 8 years, 2 months ago
      Hi bohobravo, nice you found the right way of CMSing wink

      Have you given the admin-group context-access to the other contexts?

        • 51838
        • 8 Posts
        Quote from: sebastian-marinescu at Feb 26, 2016, 01:33 PM

        Have you given the admin-group context-access to the other contexts?

        I'm the only user - who setup all the subdomains & contexts, so why add other users? Maybe I'm not understanding correctly how MODX works in this matter.

        Anyway, gave it a try but no luck. Any links to step-by-step documentation on how to setup groups & give them context access? I'm not that tech-savvy (yet). smiley

        Thanks! [ed. note: bohobravo last edited this post 8 years, 2 months ago.]
        • If you go into the context settings by right clicking on the context and then selecting Update Context, then go to the Access Permissions tab and see if there are any groups there or not. Adding an access permission (there should be an Administrator group) and you want to add that to each context and also make sure you select the Administrator Access Policy as well.

            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
            • 51838
            • 8 Posts
            Quote from: smashingred at Feb 26, 2016, 02:10 PM
            Adding an access permission (there should be an Administrator group) and you want to add that to each context and also make sure you select the Administrator Access Policy as well.

            That's how I've set my contexts up from the start:

            • user group: administrator
            • authority: 0
            • access policy: administrator

            Check out all my group http://1drv.ms/1RsWEzL & context settings http://1drv.ms/1RsWV5N

            Any mistakes? [ed. note: bohobravo last edited this post 8 years, 2 months ago.]
              • 44665
              • 60 Posts
              sebastian-marinescu Reply #6, 8 years, 2 months ago
              Hm... no mistakes, your setup looks good.

              Just to make sure, have you also cleared cache and flushed all sessions?
              https://forums.modx.com/thread/31157/preview-of-unpublished-document-not-working-in-new-context#dis-post-484082

              Or as Susan suggested in that thread you could try https://modx.com/extras/package/xrouting
                • 51838
                • 8 Posts
                Quote from: sebastian-marinescu at Feb 26, 2016, 04:58 PM
                Just to make sure, have you also cleared cache and flushed all sessions?
                https://forums.modx.com/thread/31157/preview-of-unpublished-document-not-working-in-new-context#dis-post-484082

                Cache cleared constantly but 'flush all sessions'?

                Read the article (see first post) but a session_cookie_domain makes it even worse (no access to manager at all anymore).

                I could try XRouting, but that doesn't solve this mystery... smiley And will it solve the access issues? Because everything else works fine, for instance, when site_status is yes, the sub-site shows up perfectly. [ed. note: bohobravo last edited this post 8 years, 2 months ago.]
                  • 44665
                  • 60 Posts
                  sebastian-marinescu Reply #8, 8 years, 2 months ago
                  Quote from: bohobravo at Feb 26, 2016, 05:17 PM
                  Cache cleared constantly but 'flush all sessions'?

                  From your first post, the forum-post of @opengeek:
                  Note that once you change the system setting, you will need to login again; if you have trouble,
                  try truncating the modx_sessions table in your database via phpmyadmin or your preferred database client.

                  So you could/should try the session_cookie_domain setup again, then connect through ftp and clear the
                  /core/cache/*.*
                  folder and then login to phpmyadmin and empty the
                  modx_sessions
                  table. Let us know if it works!
                    • 51838
                    • 8 Posts
                    Quote from: sebastian-marinescu at Feb 26, 2016, 06:42 PM
                    So you could/should try the session_cookie_domain setup again, then connect through ftp and clear the
                    /core/cache/*.*
                    folder and then login to phpmyadmin and empty the
                    modx_sessions
                    table. Let us know if it works!

                    I did all mentioned above - and in the thread - a week ago and nothing helped. Sorry that wasn't clear before, I'm not so familiar with all the terminology yet.

                    The thing with the session_cookie_domain is, that when I do this, I'm not prompted to login again, but when I refresh my page, I do get the manager-login screen. When I then enter my data, nothing happens. No error message, only the same login screen. The only way to then get back into to MODX manager, is removing the setting through phpmyadmin.

                    I even reinstalled everything and started over completely fresh, without any success...
                      • 44665
                      • 60 Posts
                      sebastian-marinescu Reply #10, 8 years, 2 months ago
                      Okay, no problem.

                      Just curious: with your current setup (without session_cookie_domain), what happens if you go to subdomain.yourdomain.tld/manager? If it shows the manager, you should be able to log in and then see this subdomain's content even it the site is offline... could you just check?

                      Quote from: bohobravo at Feb 26, 2016, 08:17 PM
                      The thing with the session_cookie_domain is, that when I do this, I'm not prompted to login again, but when I refresh my page, I do get the manager-login screen. When I then enter my data, nothing happens. No error message, only the same login screen. The only way to then get back into to MODX manager, is removing the setting through phpmyadmin.

                      I also stumbled upon this behavior (but not with your particular scenario). In my experience, when the login doesn't work and just reloads the login-page without warning, it is because the user trying to log in has no access-permissions to enter the manager-context. It happened for a test-user-account of mine, and when I checked, the user-group had no context-access permission for mgr.

                      But it seems in your case your user should have access. What you could check is emptying your browser cache (especially the cookies/sessions data), or trying to log in from another browser, because the session-cookie in your browser's request could still be stored when trying to log in and maybe this confuses MODX after changing the session_cookie_domain.