On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi Guys,
    This is a project I have been working on for some time. I'm slowly getting over each hump as I come to it.
    Sorry this is so long winded but I reckon more is better and may save a lot of questions.

    My Goal is to move a copy of my Production Web page onto a private Development server.
    The production page was written by an external company and is still hosted on their web server.
    They have given me ftp access to the files and a backup of mySql in a dump.sql

    I plan to develop / update some content on my development server and then move it into production once tested.

    Development Machine
    ===================
    I'm have installed Modx Revo version 2.2.6-PL which is the same version production. I copied the setup folder off the production server and ran it. Setup connected to my local My local MYSQL db no problem. This was restored from a dump.sql file.

    The server is running Debian Wheezy. Apache is version 2.2.22 and PHP is Version 5.4.4-14+deb7u3.

    All the static files that make up my web pages were copied off production into development using FTP.
    I have done a file compare of the contents of all files and nothing seems to be corrupted.

    OK
    The Problem
    =============
    when I load http://myIPaddress/index.php I received the following error
    Error 503
    Site temporarily unavailable

    Almost the same thing when I try and load http:/myIPaddress/manager
    It just says
    Site temporarily unavailable

    When I look into index.php it appears that the error comes from this section. (I edited the title text to be sure)
    (both the index.php and /manager page show my edited title)

    /* include the modX class */
    if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
        $errorMessage = 'Site temporarily unavailable';
        @include(MODX_CORE_PATH . 'error/unavailable.include.php');
        header('HTTP/1.1 503 Service Unavailable');
        echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
        exit();
    }
    


    My model/modx folder is actually not of the web server root folder.
    It is located here core/model/modx

    This folder structure is matching on both production and development.
    The mysteries of htaccess still allude me at the moment but havn't had much time to figure it out so far.
    From what I can tell all my htaccess files are named ht.access so should not have any effect.

    Does anyone know what is going on here?

    This question has been answered by multiple community members. See the first response.

    • discuss.answer
      The odds are that the MODX_CORE_PATH constant is incorrect.
      Did you run setup after moving the files? That will usually straighten out the paths.

      If not, there are four files that tell MODX where things are:

      These just point to the core directory:

      config.core.php (modx root)
      manager/config.core.php
      connectors/config.core.php


      This one has the all the paths to the parts of MODX:

      core/config/config.inc.php








        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • discuss.answer
        For one thing, that version of MODX is old, and has known security vulnerabilities. The "external company" is highly remiss in not keeping the site updated. It should at least be updated to 2.2.16 if you don't want to go to the 2.3 branch.

        There are four files you need to check. Three are config.core.php files, one in the installation root, one in /connectors/ and one in /manager/. Make sure they are pointing to the actual location of your /core/ folder. Then in core/config/config.inc.php make sure that all of the paths are correct, as well as the database connection information. For example, mine reads
        define('MODX_CORE_PATH', '/Applications/MAMP/htdocs/revo232/core/');
        


        Look out for the path to /assets/, it's near the bottom of the config.inc.php file and easy to miss. Also take care to check the $dbase_dsn line up in the database connection section.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • Hi Bob, Sottwell, Other Readers,
          Thanks for the replies. I have followed your steps and I also found this document....
          http://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

          It seems to detail what you are saying exactly. (Other documents I found earlier were incomplete)
          I have carefully checked and updated all these files.

          <Time Passes>

          Apparently not carefully enough smiley
          With the help of apache error log I found 3 typos' in my changes (arg!)

          I ran the setup again it progressed to the end with no errors.

          Some of my pages now load but not all of them.

          The /manager screen look really plain like all the graphics and formatting have been removed.
          When I view the source of my public web server /manager page I see the html code below.
          You can see the /manager portion of the href= lines are missing.
          The Manager Path in the file /var/www/core/config/config.inc.php looks good to me.
          <Extract>
          if (!defined('MODX_MANAGER_PATH')) {
          $modx_manager_path= '/var/www/manager/';
          $modx_manager_url= '/';
          define('MODX_MANAGER_PATH', $modx_manager_path);
          define('MODX_MANAGER_URL', $modx_manager_url);
          }

          <head>
          	<title>Manager Login</title>
          	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                  
              <link rel="stylesheet" type="text/css" href="/manager/assets/ext3/resources/css/ext-all-notheme-min.css" />
          	<link rel="stylesheet" type="text/css" href="/manager/templates/default/css/xtheme-modx.css" />
          	<link rel="stylesheet" type="text/css" href="/manager/templates/default/css/index.css" />
              <link rel="stylesheet" type="text/css" href="/manager/templates/default/css/login.css" />
              
              <script src="assets/ext3/adapter/ext/ext-base.js" type="text/javascript"></script>
              <script src="assets/ext3/ext-all.js" type="text/javascript"></script>
              <script src="assets/modext/core/modx.js" type="text/javascript"></script>
          
              <script src="assets/modext/core/modx.component.js" type="text/javascript"></script>
              <script src="assets/modext/util/utilities.js" type="text/javascript"></script>
          	<script src="assets/modext/widgets/core/modx.panel.js" type="text/javascript"></script>
              <script src="assets/modext/widgets/core/modx.window.js" type="text/javascript"></script>
              <script src="assets/modext/sections/login.js" type="text/javascript"></script>
              
              <meta name="robots" content="noindex, nofollow" />
          </head>


          Yet my development server looks like this
          <head>
          	<title>Manager Login</title>
          	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                  
              <link rel="stylesheet" type="text/css" href="/assets/ext3/resources/css/ext-all-notheme-min.css" />
          	<link rel="stylesheet" type="text/css" href="/templates/default/css/xtheme-modx.css" />
          	<link rel="stylesheet" type="text/css" href="/templates/default/css/index.css" />
              <link rel="stylesheet" type="text/css" href="/templates/default/css/login.css" />
              
              <script src="assets/ext3/adapter/ext/ext-base.js" type="text/javascript"></script>
              <script src="assets/ext3/ext-all.js" type="text/javascript"></script>
              <script src="assets/modext/core/modx.js" type="text/javascript"></script>
          
              <script src="assets/modext/core/modx.component.js" type="text/javascript"></script>
              <script src="assets/modext/util/utilities.js" type="text/javascript"></script>
          	<script src="assets/modext/widgets/core/modx.panel.js" type="text/javascript"></script>
              <script src="assets/modext/widgets/core/modx.window.js" type="text/javascript"></script>
              <script src="assets/modext/sections/login.js" type="text/javascript"></script>
              
              <meta name="robots" content="noindex, nofollow" />
          </head>


          PS It seems that me running Setup again recreated the config.inc.php file again with the default values.

          Any ideas what this means?


          Let me know if you think I should start a new thread for this new error.

          Thanks
          David

          • Get into the database in the system_settings table and set compress_css and compress_js to 0.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
            • Hi Sottwell,
              I found those two settings. They were both set to 1
              I have set them both to 0.
              I restarted apache but the manager page still does not load correctly.

              Any other ideas?

              Thanks Again
              David
              • The Manager uses a lot of AJAX requests. Some servers are configured with security settings that don't permit more than a given number of requests from the same IP in a given amount of time. This can prevent the Manager from loading all of its sections via AJAX requests.

                There may be two primary limitations: both are handled by the server. Concurrent Connections is one... Requests per Interval is another.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                • Sottwell,
                  I have a feeling it isn't that complicated. It will be something that is stopping my paths from forming correctly.
                  Either something in one of those config files or I have missed something in a .htaccess file.

                  I'll do some more digging tomorrow and perhaps I can find something in an error log that throws some light on this.

                  David.