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

    I have problem with my Modx installation. At the end of my installion a get the following message "Error 500: Site Temporary Unavailable". I know that the chance is bog that this is a permission error. But i don't know how to set the permission so that the site is working.


    [b]The Specs are:[/b]
    - unbuntu 16.0.4
    - PHP7
    - Apache2 (user: www-data: group www-data)

    The new installation is done in the directory /var/www/html
    drwxr-sr-x 6 roderick www-data 4096 jun 17 15:10 modx-test

    I added www-data to my group:
    roderick : roderick adm cdrom sudo dip www-data plugdev lxd sambashare lpadmin

    [b]The .htaccess is as follows:[/b]
    RewriteEngine On
    RewriteBase /modx-test/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA

    The config file:
    if (!defined('MODX_CORE_PATH')) {
    $modx_core_path= '/var/www/html/modx-test/core/';
    define('MODX_CORE_PATH', $modx_core_path);
    }
    if (!defined('MODX_PROCESSORS_PATH')) {
    $modx_processors_path= '/var/www/html/modx-test/core/model/modx/processors/';
    define('MODX_PROCESSORS_PATH', $modx_processors_path);
    }
    if (!defined('MODX_CONNECTORS_PATH')) {
    $modx_connectors_path= '/var/www/html/modx-test/connectors/';
    $modx_connectors_url= '/modx-test/connectors/';
    define('MODX_CONNECTORS_PATH', $modx_connectors_path);
    define('MODX_CONNECTORS_URL', $modx_connectors_url);
    }
    if (!defined('MODX_MANAGER_PATH')) {
    $modx_manager_path= '/var/www/html/modx-test/manager/';
    $modx_manager_url= '/modx-test/manager/';
    define('MODX_MANAGER_PATH', $modx_manager_path);
    define('MODX_MANAGER_URL', $modx_manager_url);
    }
    if (!defined('MODX_BASE_PATH')) {
    $modx_base_path= '/var/www/html/modx-test/';
    $modx_base_url= '/modx-test/';
    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='webserver.nl';
    define('MODX_HTTP_HOST', $http_host);
    } else {
    $http_host= array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'webserver.nl';
    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= '/var/www/html/modx-test/assets/';
    $modx_assets_url= '/modx-test/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);
    }

    If someone can tell mee how to set the persmission so that the site is working that would me nce. Already thanks.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Permissions should typically be 0755 (directories)/0644 (files), but there's also other possible reasons for that error. Check your server (apache/nginx) error log and the MODX error log located in core/cache/logs/error.log to see if there's any issues logged there.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 41056
        • 10 Posts
        Hello Mark,

        I have set the file permission to 644 and the directory permission to 755. The result is the same "Error 500: Site Temporary Unavailable".

        modx log report:

        [2017-06-18 09:33:16] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 09:33:16] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 09:33:16] (FATAL) Could not load core MODX configuration!
        [2017-06-18 09:33:24] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 09:33:24] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 09:33:24] (FATAL) Could not load core MODX configuration!
        [2017-06-18 17:14:52] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 17:14:52] (ERROR @ /modx-test/index.php) Error 42S02 executing statement:
        Array
        (
        [0] => 42S02
        [1] => 1146
        [2] => Table 'modx-test.modx_system_settings' doesn't exist
        )

        [2017-06-18 17:14:52] (FATAL) Could not load core MODX configuration!

        apache error log:

        [Sat Jun 17 14:25:08.808673 2017] [:error] [pid 24771] [client 192.168.178.12:61294] PHP Notice: Undefined index: primary in /var/www/html/modx-test/core/xpdo/om/mysql/xpdomanager.class.php on line 462, referer: http://webserver.nl/modx-test/setup/index.php?action=summary
        [Sat Jun 17 14:25:08.808745 2017] [:error] [pid 24771] [client 192.168.178.12:61294] PHP Notice: Undefined index: unique in /var/www/html/modx-test/core/xpdo/om/mysql/xpdomanager.class.php on line 462, referer: http://webserver.nl/modx-test/setup/index.php?action=summary
        [Sat Jun 17 15:33:44.988677 2017] [mpm_prefork:notice] [pid 1344] AH00169: caught SIGTERM, shutting down
        [Sun Jun 18 09:27:59.125204 2017] [mpm_prefork:notice] [pid 1353] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
        [Sun Jun 18 09:27:59.151033 2017] [core:notice] [pid 1353] AH00094: Command line: '/usr/sbin/apache2'

        I am not really a modx expert. I hope you see what the problem is.

          • 3749
          • 24,544 Posts
          I doesn't look like a permissions issue. It looks like an empty database or a database prefix issue. You're connecting to the DB OK, but it's not finding the tables.

          First, look at the DB in PhpMyAdmin (or the equivalent). See if the tables are there. If they are, see what the actual table names are. The default prefix is modx_, but that may not be what's in the DB.

          Then look at this line in the core/config/config/inc.php file to see what MODX thinks the prefix is (should be line 11):

          $table_prefix = 'modx_';


            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
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            What Bob said wink Sounds like the installation may have failed to create some (or all) tables. If you haven't manually wiped the cache folder, the installation log might still be available under core/cache/logs/ to shed more information on what happened and why. If that's not there, you can also run the setup to try it again and to generate a new log.

            Perhaps there was an issue with the mysql user not having sufficient permissions to create tables (there would be no tables at all in that case), or maybe there's an incompatibility between your server and the MODX tables that it couldn't be created. There's a few issues floating around on github related to UTF8 MB4 collations, mysql strict mode etc.
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 41056
              • 10 Posts
              Quote from: BobRay at Jun 18, 2017, 11:09 PM
              I doesn't look like a permissions issue. It looks like an empty database or a database prefix issue. You're connecting to the DB OK, but it's not finding the tables.

              First, look at the DB in PhpMyAdmin (or the equivalent). See if the tables are there. If they are, see what the actual table names are. The default prefix is modx_, but that may not be what's in the DB.

              Then look at this line in the core/config/config/inc.php file to see what MODX thinks the prefix is (should be line 11):

              $table_prefix = 'modx_';



              It is not a prefix problem. In the modx error log is the following statement:

              [2017-06-19 21:04:47] (ERROR @ /var/www/html/modx-test.nl/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement:
              Array
              (
              [0] => 42S02
              [1] => 1146
              [2] => Table 'modx-test.modx_system_settings' doesn't exist
              )

              [2017-06-19 21:04:47] (ERROR @ /var/www/html/modx-test.nl/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement:
              Array
              (
              [0] => 42S02
              [1] => 1146
              [2] => Table 'modx-test.modx_system_settings' doesn't exist
              )

              [2017-06-19 21:04:47] (FATAL) Could not load core MODX configuration!

                • 41056
                • 10 Posts
                i don't have the solution for my problem for the install 2.5.0. But the problem does not exist with the installation of Modx 2.5.2.
                  • 3749
                  • 24,544 Posts
                  Table 'modx-test.modx_system_settings' doesn't exist

                  AFAIK, that error message can only mean that either the table is not in the DB, or the prefix is wrong.
                    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