nativeInstallermoodle

Modify the default Moodle(TM) LMS directory name and URL

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

By default, Bitnami LMS powered by Moodle(TM) LMS is hosted at the /moodle URL, corresponding to the installdir/apps/moodle directory. To change this URL to a different path (for example, /mysite), follow these steps:

  • Edit the installdir/apps/moodle/conf/httpd-prefix.conf file and replace all instances of moodle with the new directory name. For example, to set the directory to mysite, edit the file contents so it looks like this:

      Alias /mysite/ "installdir/apps/moodle/htdocs/"
      Alias /mysite "installdir/apps/moodle/htdocs"
      Include "installdir/apps/moodle/conf/httpd-app.conf"
    
  • Edit the installdir/apps/moodle/htdocs/config.php and replace all instances of moodle with the new directory name. For example:

      if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
          $CFG->wwwroot   = 'https://' . $_SERVER['HTTP_HOST'] . '/mysite';
      } else {
          $CFG->wwwroot   = 'http://' . $_SERVER['HTTP_HOST'] . '/mysite';
      };
    
  • Restart the server:

      $ sudo installdir/ctlscript.sh restart apache
    

You should now be able to access Moodle(TM) LMS at the /mysite URL path.

Last modification November 17, 2020