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

    Please excuse if this a newbie question I am new to Modx.

    I am going to be using Modx Revolution 2.0 on an existing site.
    I want to put Modx in a subdirectory example: site.com/test/
    develop the site in Modx to my satisfaction than move it to the root directory.

    What is the best way to do this?
    is there any gotchas or things I should look out for when doing this?

    Thank you!

    Matt
      • 22303 MODX Staff
      • 10,725 Posts
      There are some bugs in RC-1 and previous releases that would require some manual file manipulation for this to work smoothly. This workflow will be supported though in the final release, hopefully before.

      That said, your best bet might be using MODx with a core located outside the webroot altogether, or in the webroot rather than the subdirectory. The latter can be done by using the advanced package, which extracts all of the files to locations you specify during setup; just extract the advanced package into the root and during setup, it will ask you where you want the . Then when you are done developing, so long as you do not hardcode paths to the subdirectory location in your site content, the site should be portable by simply moving the remaining MODx directories to the root from test, modifying any .htaccess changes made for friendly URL rewriting in test/, and editing your config file to update the path and url locations specified there. There will also be some Settings that contain paths or urls that would need to be updated once the site was moved to the new location, though identifying all of these would depend on what specific Extras you had installed. filemanager_path is one that comes to mind in the core.

      Now, I’m not trying to discourage you from doing it by putting the whole thing in a subdirectory, but just know there are some bugs already identified, and that this is not a workflow we use often when developing the core. IOW, you will be pioneering a bit using RC-1 in this way. Someone has to do it though; this will be a useful approach for those on shared servers. Just don’t be surprised if you have to get additional help and/or report bugs regarding the process.
        • 3749
        • 24,544 Posts
        Would some (or maybe all) of those issues be solved by running an upgrade install after moving the site to the root?

          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
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          I can taste a tutorial in the works: how to secure your MODx site by putting the manager directory somewhere else on your server for limited access...

          What is going to be recommended best practices here for securing a site in this manner? The manager has to be accessible via the web... say you put it on a domain that’s behind a firewall that only allows connections from your office... are there other tactics that could be deployed to make the manager less vulnerable?

          I think this may be a first for the MODx forums, but I’m posting from South Park, CO.
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: BobRay at May 23, 2010, 01:34 AM

            Would some (or maybe all) of those issues be solved by running an upgrade install after moving the site to the root?
            Only some; the bugs I mentioned are related...which is why I described how to manually make the changes to the config file, etc.

            Quote from: Everett at May 23, 2010, 12:32 PM

            I can taste a tutorial in the works: how to secure your MODx site by putting the manager directory somewhere else on your server for limited access...
            Definitely; you can, at install time in the advanced distribution, put your manager directory anywhere you want, and name it what you want. This is why each of the main directories in Revolution uses a config.core.php to locate the core (which can also be located anywhere on the server; putting the core outside the webroot for instance will be a recommended best practice).

            Quote from: Everett at May 23, 2010, 12:32 PM

            What is going to be recommended best practices here for securing a site in this manner? The manager has to be accessible via the web... say you put it on a domain that’s behind a firewall that only allows connections from your office... are there other tactics that could be deployed to make the manager less vulnerable?
            Freedom is the key here; we’re trying to make it so you can secure it in whatever way makes the most sense for your environment. So yes, as long as the web is accessible to the web in some way, you can hide it on internal network domains, and/or obscure it’s location with a crazy folder name, etc. I’d love to hear other ideas as well...

            Quote from: Everett at May 23, 2010, 12:32 PM

            I think this may be a first for the MODx forums, but I’m posting from South Park, CO.
            You bastard! And you didn’t come through Taos?