We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9273
    • 3 Posts
    Hello to all,
    Hope that this is the right place to post this.
    I worked hard lately to successfully run MODx Evolution 1.0.2 from CD with server2go. At the end of the experience I want to propose some "good practice" (don’t take too seriously - there is nothing wrong here) for future development of MODx:

    * consistency in the use of paths constants (MODX_BASE_PATH, MODX_MANAGER_PATH, etc.). Though there is nothing wrong in using MODX_BASE_PATH to include a file residing within the manager directory, a more clean approach is to use "MODX_MANAGER_PATH".

    * creating a path constant for assets directory. I think of "MODX_ASSETS_PATH".

    * provide the possibility to use config["manager_path"] and config["assets_path"].

    There is nothing original here, but for a project such as using modx from a CD it is a must.

    Thank you.
      • 9273
      • 3 Posts
      Oups, forgot to mention that, I am available to provide some help to those who are interested in running MODx from CD.
      The process is somehow long and I can’t post it here. (PM me)
      Thanks.
        • 9273
        • 3 Posts
        A short introduction on configuring MODx and server2go for running from CD or USB Disk

        Preparing MODX

        - Avoid messing the use of path to include files residing in root/manager and root/assets.

        - Ensure that the path towards root/manager is used by everywhere to include files residing within root/manager. Same for root/assets. (This is the most time consuming part). In my case I decided to create a new constant called MODX_ASSETS_PATH.

        - The value of "[tt]MODX_ASSETS_PATH[/tt]" is set to [tt]str_replace("\\", "/", $_ENV["S2G_DB_PATH"]) . ’assets/’;[/tt];

        - replace any occurrence of [tt]$_SERVER[’SERVER_PORT’][/tt] with [tt]$_ENV["S2G_APACHE_PORT"][/tt];

        - move all "[tt]assets[/tt]" into "[tt]dbdir[/tt]" or "[tt]dbdir/server2go[/tt]" directory of MODX.



        Preparing server2Go

        - Modify [tt]httpd.conf[/tt] file residing in "[tt]server/config_tpl[/tt]" (server2go) by creating alias towards "[tt]assets[/tt]" which now reside in "[tt]dbdir[/tt]" or "[tt]dbdir/server2Go[/tt]" (I recommend "dbdir").
        * Here is my example for alias: [tt]Alias /assets "%CDPMS:DBDIR%\assets";[/tt]
        * Uncomment [tt]mod_rewrite[/tt];
        * On line "217" set [tt]AllowOveride[/tt] to [tt]All[/tt];
        * Create a new entry as follow:
        [tt]<Directory "%CDPMS:DBDIR%\assets">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        </Directory>;[/tt]

        - Modify [tt]php.ini[/tt] file residing in "[tt]server/config_tpl[/tt]" by setting [tt]register_global [/tt]to [tt]Off[/tt].
        - In my case I also set [tt]error_log[/tt] to [tt]error_log = "%CDPMS:DBDIR%\php_error.log";
        [/tt]
        c) The next step is to configure [tt]pms_config.ini[/tt] file as per server2go documentation.

        With all the above, you are on the way to running MODX from CD.

        *** Performance issue with this method ***
        When running from CD, server2go will copy all the content of Assets to the local hard disk. This may take some times.

        Good luck.