We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48842
    • 37 Posts
    I have (so far) 2 MODX installations on 1 server.

    The first installation setup properly and works fine. The URL calling it, say domain1.com has nginx pull data from /home/Websites/company1/public/www (where the MODX install resides)

    The second installation setup initially did NOT work, but then after reboot did. That URL, say domain2.com has nginx pull data from /home/Websites/company2/public/www (where a different MODX resides)

    The error I got from the failing install was (of course) the dreaded:

    "Checking database: MODX could not create your database. Please manually create your database and then try again." [This has GOT to be solved. Forum messages abound on this one and there does not seem to be a best practice except for checking login credentials and/or creating an empty DB.)

    I am CERTAIN I had the db login name, DB password and db name correct.

    I tried BOTH starting with NO database and with an empty database (with the correct name). Same error in both cases.

    I also tried changing the "MODX configuration key" but this should not be an issue either way since I am not using the same core for both instances! Same error in both cases.

    There are NO errors logged regarding MariaDB problems
    /var/log/php5-fpm.log is good
    /var/log/nginx/ access.log AND error.log are both good

    Anyway, after reboot, install worked fine. [What's the reason for that, BTW? This is a Linux machine on which nothing substantive changed between MODX install 1 and 2 . I never need to reboot my Linux machines except for MODX. I must be doing something wrong! ]

    Anyway, after reboot, the MODX install related to domain2.com worked, but when trying to view the publicly served main page OR the manager I get an http 500 error.

    Nginx logs NO errors.

    Meanwhile, domain1.com is working . . . for the moment.
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      It sounds like there is a problem with your server configuration, could you tell us more about how everything is configured? I can confirm that MODX works fine with NGINX / PHP5-FPM and MariaDB.
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 48842
        • 37 Posts
        Hi AMDbuilder

        Thanks!

        Quote from: AMDbuilder at Sep 22, 2014, 01:07 AM
        It sounds like there is a problem with your server configuration, could you tell us more about how everything is configured? I can confirm that MODX works fine with NGINX / PHP5-FPM and MariaDB.

        This is all running on Ubuntu 14.04 and nginx 1.4.6 , MariaDB 10.0.13 and PHP 5.5.9-1ubuntu4.4 .

        The last is gleaned from a page calling phpinfo(). That page resides in a utility folder under the MODX install called by domain2.com, where MODX does not work (wanted to check whether PGP was having a major problem there specifically). PHP-fpm connects to nginx via unix socket (and as I mentioned, the whole setup works brilliantly for domain1.com )

        I should mention that in the domain2.com install I tried "hardening" MODX by relocating/renaming not only the core but also the manager. This was done using the advanced MODX installer package. There were no errors thrown during install and the core is properly referenced in the config.core.php file. It is unclear to me at the moment where the "manager" location and URL referemce (which was also renamed) are referenced.

        Perhaps I should NOT try a hardened install and move these folders later?

        I can try that in a few hours, but the installer not throwing errors gave "confidence" that everything should work! :-(
          • 48842
          • 37 Posts
          So I have a couple moments and nuked the domain2.com MODX directory.

          Trying an advanced install, I am stuck once again at an earlier point in the installation: "Checking database: MODX could not create your database. Please manually create your database and then try again." This, in spite of "Connecting to database server: Success!"

          An empty MariaDB is sitting there waiting to be populated. I have the correct connection parameters put in the MODX installer. The empty DB seems to be the most "reliable" way for getting the MODX installer to work, although I rarely get a better than 20% success rate at this point! ]

          Is there a particular required ownership:groupness for MODX (and could this also affect DB creation/population somehow)?

          I have read suggestions for both root:www-data and www-data:www-data [I have tried both and get the same (ineffective) results either way. ]

          My understanding is that all folders should be 0755 and files 0644

          How can I tell what user the php-fpm process is using (I assume www-data, but assumption is not a good way of proceeding)? That might logically be the source of the problem! [ed. note: fbachofner last edited this post 12 years ago.]
            • 48842
            • 37 Posts
            Quote from: fbachofner at Sep 22, 2014, 08:47 AM

            How can I tell what user the php-fpm process is using (I assume www-data, but assumption is not a good way of proceeding)? That might logically be the source of the problem!

            OK, in /etc/php5/fpm/pool.d/www.conf both user and group are specified as www-data

            Also, in other forum posts, PHP memory allocation limit is recommended to be >=64M I am at 128M [verified by the page calling phpinfo() ]

            I am even getting the DB creation error when all folders and files in the MODX and core directories are set to mode 0777
              • 48842
              • 37 Posts
              Today I updated nginx to 1.6.2, the current stable version. Had <sarcasm>great fun</sarcasm> getting everything to work again. Nginx has changed the default nginx.conf significantly in a couple ways, but I've got it all sorted now.

              Meanwhile, I had this great idea:

              Take MODX install from domain1.com (which is working) and copy to the (first emptied) folders related to domain2.com

              Then, change connection strings, PWs, etc., folder references and a differently named DB (i.e. a copy with the same data, initially)

              Brilliant! domain2.com now "works" -- sort of.

              PROBLEM: the sites are linked up in bizarre ways (probably because they share the same: $site_id $site_sessionname and $uuid ). Gee, if MODX install had allowed me to create or populate a DB on a fresh install of domain2.com I'm pretty sure this issue wouldn't be happening! [How can I "generate" new values for these variables when the MODX installer cooperates so poorly (at the DB creation stage)? ]

              Question Linux/PHP gurus: does one HAVE TO set up different pools at /etc/php5/fpm/pool.d even if I don't have concerns (right now) about cross site scripting issues. Is this a hard-coded requirement?
                • 1343 ☆ A M B ☆
                • 2,213 Posts
                I'm glad to hear you got the problem resolved. I'll leave your outstanding issue for someone else to address, however in regards to your linux question: No. It's recommended, but not required.
                  Patrick | Server Wrangler
                  About Me: Website | Tweets |  MODX Hosting
                  • 3749
                  • 24,544 Posts
                  I'm not sure I understand what you're trying to do, but if you want separate tables for the second install, but in the same database, you can change the table prefix during the install.
                    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