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

    Finished my first modx site, and impressed by how rapidly i managed to put it all together. I'm sold on modx as a CMS.

    You can see a finished version on a test location at: http://trullo.davidhunterdesign.com/

    I am trying to move it to the proper server and have run into some problems. I followed the steps in the guide http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server

    I did a re-run of setup and that seemed to confirm everything was OK. But I did get the occasional warning like:

    Warning: chmod() has been disabled for security reasons in /web2/user22392/website/core/model/smarty/sysplugins/smarty_internal_write_file.php on line 44


    I can log on to the manager and all the resources and elements are present and correct but there is nothing under the files tab and folder.

    When I try to view a page it just loads the manager opening home page.

    What could this be caused by or what have I missed?

    All help greatly appreciated.

    David

      • 35103
      • 54 Posts
      I have a holding page at the moment while I try to fix this problem, but you can see what I mean where going to index.php takes you to the manager as does a page with an id:

      http://www.trullorestaurant.com/index.php

      http://www.trullorestaurant.com/index.php?id=3

      any help greatly appreciated!
        • 3749
        • 24,544 Posts
        That's very strange. Take a look at the paths in core/config/config.inc.php.

        Look also at any .htaccess file and at the index.php file in the root. There's no way I know of that the standard index.php file in the root would send you to the Manager directory, which appears to be what's happening.
          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
          • 36906
          • 34 Posts
          TheNewManifesto Reply #4, 15 years ago
          Hi David,
          Nice website, looks great.

          When moving sites to a new box, I tend to just grab everything needed (files + DB) and put it in place manually without running setup again.

          The chmod error seems to be down to restrictions on the server, against the webserver user.
          It doesn't seem to have permissions to access one or more files - possible during setup.


          Are you able to chmod/chown manually from the command line?

          If so, just make sure all of the files are owned by the web server user, set files to 664, and folders to 775.

          eg.

          cd /var/www/davidhunterdesign.com/httpdocs
          
          chown -R www-data:www-data .
          
          find /var/www/davidhunterdesign.com/httpdocs -path '*/.svn' -prune -o -path '*.svnignore' -prune -o -type d -exec chmod 0775 '{}' \;
          
          find /var/www/davidhunterdesign.com/httpdocs -path '*/.svn' -prune -o -path '*.svnignore' -prune -o -type f -exec chmod 0664 '{}' \;
          
          chmod -R 0777 /var/www/davidhunterdesign.com/httpdocs/assets/components;
          
          chmod -R 0777 /var/www/davidhunterdesign.com/httpdocs/core/cache;
          
          chmod -R 0777 /var/www/davidhunterdesign.com/httpdocs/core/packages;
          
          chmod -R 0444 /var/www/davidhunterdesign.com/httpdocs/core/config/config.inc.php;
          
          find /var/www/davidhunterdesign.com/httpdocs/core/cache -path '*/.svn' -prune -o -path '*.svnignore' -prune -o -path '*config.cache.php' -prune -o -path '*sitePublishing.idx.php' -prune -o -type f -exec rm {} +;
          
          
          
          


          The last step can be done via the manager, but I tend to use the above in a little shell script to automate the process.

          Please note, if you use the above, make sure you set the file paths correctly to avoid problems, and make a safe backup beforehand!!

          Some of the permissions can probably be restricted further.
          Let us know if that helps, and we can try and help from there.


          p.s, I hadn't seen Bobs reply at the time, but as always its good advice!
          [ed. note: thenewmanifesto last edited this post 15 years ago.]
            • 35103
            • 54 Posts
            Thanks for getting back to me guys.

            BobRay, I have been through the core/config/config.inc.php file a couple times but I'll go through it again in case I missed something.

            TheNewManifesto, I have no command line access to the server (thanks to the hosting company) but I changed everything to 777.

            It concerns me that nothing is showing in the files tab of the manager. Would that be related to a path in the core/config/config.inc.php file? Or something in the install/update process? Something missing from the database I copied over? Or something else?

            Will post back here shortly...
              • 36906
              • 34 Posts
              TheNewManifesto Reply #6, 15 years ago

              hmmm, I'll keep thinking - sorry that hasn't fixed it for you.
              Is there anything in the web server error_log that looks suspect?

              You did clear the cache?

                • 35103
                • 54 Posts
                Yeah I cleared the cache before dumping the database (which I did through phpmyadmin) and on the new server I have cleared the cache and flushed all sessions and permissions several times.

                Will changing the permissions to 750 and 664 not make any difference than setting them to 777?
                  • 35103
                  • 54 Posts
                  i have checked everything. the only thing i was missing was .htaccess file (hidden on a mac) which i have put on and changed the rewriteBase to "/" and that hasn't made the difference.
                  
                  below is my config.inc.php file with database details ommitted:
                  
                  <?php
                  /**
                  * MODX Configuration file
                  */
                  $database_type = 'mysql';
                  $database_server = 'xxxxxxxxxxxxxxxx';
                  $database_user = 'xxxxxxxxxxx';
                  $database_password = 'xxxxxxxxxxxxxxxx';
                  $database_connection_charset = 'utf8';
                  $dbase = 'xxxxxxxxx';
                  $table_prefix = 'test_';
                  $database_dsn = 'mysql:host=xxxxxxxxxxxxxxxx;dbname=xxxxxxxxx;charset=utf8';
                  $config_options = array (
                  );

                  $lastInstallTime = 1318863814;

                  $site_id = 'modx4e9c43c6a657f7.48718170';
                  $site_sessionname = 'SN4e857ea1dba2d';
                  $https_port = '443';
                  $uuid = '80be1a4d-ef56-4ac7-9c29-9f5243c7d3a6';

                  if (!defined('MODX_CORE_PATH')) {
                  $modx_core_path= '/web2/user22392/website/core/';
                  define('MODX_CORE_PATH', $modx_core_path);
                  }
                  if (!defined('MODX_PROCESSORS_PATH')) {
                  $modx_processors_path= '/web2/user22392/website/core/model/modx/processors/';
                  define('MODX_PROCESSORS_PATH', $modx_processors_path);
                  }
                  if (!defined('MODX_CONNECTORS_PATH')) {
                  $modx_connectors_path= '/web2/user22392/website/connectors/';
                  $modx_connectors_url= '/connectors/';
                  define('MODX_CONNECTORS_PATH', $modx_connectors_path);
                  define('MODX_CONNECTORS_URL', $modx_connectors_url);
                  }
                  if (!defined('MODX_MANAGER_PATH')) {
                  $modx_manager_path= '/web2/user22392/website/manager/';
                  $modx_manager_url= '/manager/';
                  define('MODX_MANAGER_PATH', $modx_manager_path);
                  define('MODX_MANAGER_URL', $modx_manager_url);
                  }
                  if (!defined('MODX_BASE_PATH')) {
                  $modx_base_path= '/web2/user22392/website/';
                  $modx_base_url= '/';
                  define('MODX_BASE_PATH', $modx_base_path);
                  define('MODX_BASE_URL', $modx_base_url);
                  }
                  if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                  $isSecureRequest = false;
                  } else {
                  $isSecureRequest = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
                  }
                  if (!defined('MODX_URL_SCHEME')) {
                  $url_scheme= $isSecureRequest ? 'https://' : 'http://';
                  define('MODX_URL_SCHEME', $url_scheme);
                  }
                  if (!defined('MODX_HTTP_HOST')) {
                  if(defined('PHP_SAPI') && (PHP_SAPI == "cli" || PHP_SAPI == "embed")) {
                  $http_host='www.trullorestaurant.com';
                  define('MODX_HTTP_HOST', $http_host);
                  } else {
                  $http_host= $_SERVER['HTTP_HOST'];
                  if ($_SERVER['SERVER_PORT'] != 80) {
                  $http_host= str_replace(':' . $_SERVER['SERVER_PORT'], '', $http_host); // remove port from HTTP_HOST
                  }
                  $http_host .= ($_SERVER['SERVER_PORT'] == 80 || $isSecureRequest) ? '' : ':' . $_SERVER['SERVER_PORT'];
                  define('MODX_HTTP_HOST', $http_host);
                  }
                  }
                  if (!defined('MODX_SITE_URL')) {
                  $site_url= $url_scheme . $http_host . MODX_BASE_URL;
                  define('MODX_SITE_URL', $site_url);
                  }
                  if (!defined('MODX_ASSETS_PATH')) {
                  $modx_assets_path= '/web2/user22392/website/assets/';
                  $modx_assets_url= '/assets/';
                  define('MODX_ASSETS_PATH', $modx_assets_path);
                  define('MODX_ASSETS_URL', $modx_assets_url);
                  }
                  if (!defined('MODX_LOG_LEVEL_FATAL')) {
                  define('MODX_LOG_LEVEL_FATAL', 0);
                  define('MODX_LOG_LEVEL_ERROR', 1);
                  define('MODX_LOG_LEVEL_WARN', 2);
                  define('MODX_LOG_LEVEL_INFO', 3);
                  define('MODX_LOG_LEVEL_DEBUG', 4);
                  }
                  if (!defined('MODX_CACHE_DISABLED')) {
                  $modx_cache_disabled= false;
                  define('MODX_CACHE_DISABLED', $modx_cache_disabled);
                  }
                  I re-ran the setup process and it still pulled the same chmod errors and after installing displays this in the browser: [codeWarning: chmod() has been disabled for security reasons in /web2/user22392/website/core/model/smarty/sysplugins/smarty_internal_write_file.php on line 44

                  Warning: Cannot modify header information - headers already sent by (output started at /web2/user22392/website/core/model/smarty/sysplugins/smarty_internal_write_file.php:44) in /web2/user22392/website/setup/includes/modinstallrequest.class.php on line 102] same as before. can still log into the manager and all the resources and elements are there but nothing in the files tab. still takes me back to the manager when i try to view a page...
                    • 1343 ☆ A M B ☆
                    • 2,213 Posts
                    How is php configured on the server?
                      Patrick | Server Wrangler
                      About Me: Website | Tweets |  MODX Hosting
                      • 35103
                      • 54 Posts
                      Hi AMDBuilder,

                      I think the php was configured fine apart from the chmod part which i had to switch on which got rid of the errors.

                      It's now working, but I think a lot of the problem was the php mentioned above and the hosting company having major issues with their mysql servers. The servers are fixed and so the site transferred ok this morning.

                      The only problem that remains is that none of the files show up in the files tab? This is critical so the client can upload new images and menus.

                      Any ideas why that might be?