We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39798
    • 8 Posts
    I've got a revolution 2.2.2 site that I am migrating to a new server. I've deployed a number of modx sites before on a few different server configurations and moved installs between servers before, but this server is a bit different of a platform from the others - it's Windows running IIS 7.5 and MySQL. Usually I'm using Linux and Apache.

    At any rate, I performed the migration, edited config files, and re-ran setup and everything went real smoothly. I can access the site but when I go to the manager, an HTTP authentication prompt shows up. I can click cancel and then proceed to log into the manager as I usually would and everything works great, but obviously this prompt is annoying.

    Through firebug I can see that the request causing the prompt is to "/connectors/lang.js.php?topic=login", which returns a 401 status and a JSON response of '{"success":false,"code":401}'. I've taken a look at the lang.js.php file and tracked down the branch of code in connectors/index.php that seems to be returning the 401 response, but beyond that I'm kind of at a loss as to why it's doing this.

    To rule out any migration issues, I tried a clean install of the 2.2.2 version and it is giving the same unauthorized response. The clean install also works great beyond this problem. I did have to disable compress_js for the manager since the calls to manager/min/index.php were returning with 400 bad request.

    Anyone have any ideas, or seen this before? Any tips on tracking down where the problem is?
      • 39798
      • 8 Posts
      I've resolved this by adding a "Load only" access permission to the "mgr" context for the anonymous group. I fail to see why this is necessary, however, and only for this deployment at that.

      Anyone have any thoughts on this? Is there any reason that load only access permission would be bad?
        • 33644
        • 14 Posts
        Hi. Do you see the bug both when entering manager section with or without WWW. I've found out that I only receive 401 not authorised when enter without www. And I have modrewrite configured to have it all redirected to www but mod rewrite is turned off in manager section.
          • 38290
          • 712 Posts
          I ran into this as well, in kind of a weird way. I hit a brick wall trying to move a development site to production, on the same many that I've done so on many times before. Everything seemed fine, but once logging into the manager I ran into this error.
          By modifying the Context Access as mentioned, then importing the database with those permissions, everything works fine.

          I should note that I'm running a Media Temple DV 4.0 server using Parallels sites configured to run as Fast CGI Applications.
            jpdevries
            • 18608
            • 112 Posts
            Quote from: ztztss at Aug 25, 2012, 12:10 AM
            I've found out that I only receive 401 not authorised when enter without www. And I have modrewrite configured to have it all redirected to www but mod rewrite is turned off in manager section.

            It solved my problem using the right url (in my case without www). The load only change had no effect.
              Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
              • 17667
              • 108 Posts
              I was pulling my hair out over this issue until I found this thread. In my case Mathias' solution was exactly right. If you have the .htaccess set up in the root folder to convert www.domain.com to domain.com make sure you access the manager at domain.com/manager.
                • 34004
                • 125 Posts
                I have just come across this issue - pretty much happened over night (I didn't change hosting).

                My rewrite rules are the same as they have been, nothing has changed:
                RewriteCond %{HTTP_HOST} .
                RewriteCond %{HTTP_HOST} !^www\.site\.com [NC]
                RewriteRule (.*) http://www.site.com/$1 [R=301,L]
                


                EDIT: don't worry. Looked in the error.log in core/cache/logs and modx_sessions is corrupt. [ed. note: ficklelife last edited this post 10 years, 2 months ago.]
                  • 45591
                  • 18 Posts
                  I'm having the same problem:

                  [Error] Failed to load resource: the server responded with a status of 401 (Not Authorized) (lang.js.php, line 0)

                  I read that this may be because of mismatches with "www." and w/o "www.". But I can’t find rewrite-statements in the .htaccess files to www (my page is running under the fqdn beta.«domain».com).

                  Any other idea that I could try? Running MODX Rev 2.4.2-pl, fresh install, no content yet. Logged in to manager, but each menu item that I click leads to nothing but a page with a menu bar and otherwise nothing - completely empty.