Deploy your Open edX powered by Bitnami on Bitnami Cloud Hosting now! Launch Now

Open edX for Bitnami Cloud Hosting

Description

Open edX is an open source online learning platform used by universities and corporations around the world to deliver courses customized to meet the specific needs of their students.

First steps with the Open edX powered by Bitnami

Welcome to your new Bitnami application running on Bitnami Cloud Hosting! Here are a few questions (and answers!) you might need when first starting with your application.

What credentials do I need?

You need two sets of credentials:

  • The application credentials that allow you to log in to your new Bitnami application. These credentials consist of a username and password.
  • The server credentials that allow you to log in to your Bitnami Cloud Hosting server using an SSH client and execute commands on the server using the command line. These credentials consist of an SSH username and key.

What is the administrator username set for me to log in to the application for the first time?

Username: user@example.com

What SSH username should I use for secure shell access to my application?

SSH username: bitnami

What are the default ports?

A port is an endpoint of communication in an operating system that identifies a specific process or a type of service. Bitnami stacks include several services or servers that require a port.

IMPORTANT: Making this application's network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Port 22 is the default port for SSH connections.

Bitnami opens some ports for the main servers. These are the ports opened by default: 80, 443, 18010.

What components are included in the Open edX powered by Bitnami?

There are three major components included in the Open edX powered by Bitnami:

  • edX Platform: Centerpiece of the Open edX architecture. It contains the Learning Management System (LMS) and the Course Management System (CMS), Studio.
  • XQueue: IDA (Independently Deployed Application) that defines an interface for the LMS to communicate with external grader services.
  • Forum: IDA used by the LMS via API to integrate discussions into the learners' course experience.

There are other components included in the Stack which are required by the Open edX services such as RabbitMQ, MongoDB, MySQL, Memcached, Apache or Elasticsearch.

See Open edX architecture for more information about the Open edX structure.

Where to find the components included in Open edX Stack?

NOTE: This is the structure defined since Eucalyptus version.

Find the components mentioned before at:

  • edX platform: /opt/bitnami/apps/edx.
  • XQueue: /opt/bitnami/apps/xqueue.
  • Forum: /opt/bitnami/apps/forum.

How to change the Open edX configuration?

Each component included in the Open edX Stack has its own configuration files:

  • The edX platform configuration files are located at /opt/bitnami/apps/edx/conf/.
  • The XQueue configuration files are located at /opt/bitnami/apps/xqueue/conf/.
  • The edX forum configuration files are located at /opt/bitnami/apps/forum/conf/.
NOTE: Any modifications made in the configuration files will be loaded after restarting the Apache server.

How to access the different services in the Open edX Stack?

NOTE: Remember to replace the SERVER-IP placeholder in the examples below with the actual IP address of your (edX) server.

LMS

Access the edX LMS at http://SERVER-IP.

NOTE: Use HTTPS for secure connections: https://SERVER-IP.

Studio (CMS)

To access the edX Studio, browse to http://SERVER-IP/edx-studio which redirects you to the proper port where Studio is listening (by default, 18010).

Django Admin console

IMPORTANT: For security reasons, Django Admin console is only accessible when using 127.0.0.1 as hostname.

To access the Django console from a remote system, you must create an SSH tunnel in order to access the Apache Web server via 127.0.0.1 in your local machine. Follow these instructions to create an SSH tunnel and remotely connect safely.

While the tunnel is active, you should be able to access the Django Admin console through the secure SSH tunnel you created, by browsing to http://127.0.0.1:LOCAL_PORT/admin.

Access Django console

Enter the following credentials to log in to the Django console:

How do the different services interact with each other in the Open edX Stack?

Services included in the Open edX Stack interact with each other in many different ways. This section describes how the services interact and how you can access them.

Forum and LMS

The LMS communicates with the Forum service through an API at http://localhost:18080 for integrating discussions into the learners' course experience.

NOTE: This API is only accessible via localhost.

Check the edX Comments Service/Forums official documentation for more information on this.

XQueue and LMS

The LMS can communicate with the XQueue through an HTTP POST request to the URL http://SERVER-IP/xqueue/submit. The XQueue pushes a response back to the LMS with an HTTP POST request to the callback URL.

XQueue and external graders

Passive graders wait for the XQueue to send them submissions. After that, they respond synchronously with a graded response. The basic workflow comprises the following stages:

  • The LMS sends messages to a particular queue.
  • XQueue checks its settings and finds that the queue has a URL associated with it. XQueue forwards the message to that URL.
  • The passive grader receives a POST request from the XQueue and responds synchronously with the graded response.
  • XQueue forwards the graded response to the callback URL the LMS provided in its original message.
NOTE: The Bitnami Open edX Stack does not include any passiver grader.

Active graders pull messages off the XQueue and push responses back to the XQueue. The basic workflow comprises the following stages:

  • The test sends messages to a particular queue.
  • The active grader polls the XQueue by using a REST-like interface. When it receives a submission, it pushes a response back to the XQueue, also using a REST-like interface.
  • XQueue pushes the response back to the LMS.

Check the XQueue official documentation for more information on this.

How to start or stop the services?

Each Bitnami stack includes a control script that lets you easily stop, start and restart services. The script is located at /opt/bitnami/ctlscript.sh. Call it without any service name arguments to start all services:

$ sudo /opt/bitnami/ctlscript.sh start

Or use it to restart a single service, such as Apache only, by passing the service name as argument:

$ sudo /opt/bitnami/ctlscript.sh restart apache

Use this script to stop all services:

$ sudo /opt/bitnami/ctlscript.sh stop

Restart the services by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh restart

Obtain a list of available services and operations by running the script without any arguments:

$ sudo /opt/bitnami/ctlscript.sh

How to change the default administrator password?

For security, it is recommended that you change the default administrator password as soon as possible. To do so, it is necessary to access the Django console by creating an SSH tunnel. Follow the instructions below:

  • Create an SSH tunnel. Refer to the FAQ for more information on this.
  • Go to http://SERVER-IP:SOURCE-PORT/admin to access the Django admin console. Remember to replace SOURCE-PORT with the source port number specified when creating the SSH tunnel. Log in as the administrative user. Enter the following credentials:

Access Django console

  • Once you have logged in to Django, click "Change Password" in the upper-right corner.

Change Django admin password

  • On the "password change" page, enter your old password and the new password you want to use. Click "Change my password" to save the changes.

Change Django admin password

TIP: If you have configured the SMTP settings, log in as an administrator and click the "Reset Password" link. An email will be sent to your account with the instructions to reset your password.

How to configure the edX server domain name?

The edX server domain name is the default IP address or domain name assigned when the edX server is launched. In order to configure a different domain name, follow the steps below:

  • Log in to the server console.
  • Change the server domain using the bnconfig configuration tool:
NOTE: Remember to replace the NEW_SERVER_DOMAIN placeholder in the example below with the new server domain name.
   $ sudo /opt/bitnami/apps/edx/bnconfig --machine_hostname NEW_SERVER_DOMAIN
  • Rename or remove bnconfig configuration tool so that it does not change again at boot time:

    $ sudo mv /opt/bitnami/apps/edx/bnconfig /opt/bitnami/apps/edx/bnconfig.back
    

How to change the interface language?

Open edX uses Transifex, an open source translation platform, to power the translation of edX software into different languages. All translations are hosted at Transifex.com, which provides a web application allowing translators to write, submit, and manage their translations.

In order to change the language, follow the steps below:

  • Sign up and join the edX platform Transifex project as a translator. See the Transifex documentation for help with Transifex.

  • Create the ~/.transifexrc file and set your credentials as follows:

    [https://www.transifex.com]
    hostname = https://www.transifex.com
    username = USER
    password = PASS
    token =
    
NOTE: Remember to replace the USER and PASS placeholders in the previous example with your Transifex credentials.
  • Make sure that all languages you wish to download are present and uncommented in the /opt/bitnami/apps/edx/edx-platform/conf/locale/config.yaml.

  • Set the value of the LANGUAGE_CODE variable to the language you desire (for example, set it to "es_es" to translate it to Spanish) in the configuration files:

    • /opt/bitnami/apps/edx/conf/cms.env.json
    • /opt/bitnami/apps/edx/conf/lms.env.json
    • /opt/bitnami/apps/edx/edx-platform/lms/envs/common.py
  • Download the translations by running the commands below:

    $ cd /opt/bitnami/apps/edx/edx-platform
    $ sudo /opt/bitnami/apps/edx/bin/paver.edxapp i18n_robot_pull
    
  • Download the translation for the Forum by running the commands below:

    $ cd /opt/bitnami/apps/forum/cs_comments_service
    $ bundle install --with test
    $ bundle exec bin/rake i18n:pull
    
  • Restart the Apache server to load the changes.

You can find more information at the Open edX Internationalization and localization wiki page.

How to access the administration panel?

Access the administration panel by browsing to http://SERVER-IP/edx-studio.

How to enable and apply a default theme?

edX provides some default themes that you can find in the /opt/bitnami/apps/edx/edx-platform/themes/ directory. To enable and apply a default theme for edX, follow the steps in the sequence shown:

Enable a default theme

  • To enable a default theme for LMS, open the /opt/bitnami/apps/edx/conf/lms.env.json file and edit the "COMPREHENSIVE_THEME_DIRS" and the "ENABLE_COMPREHENSIVE_THEMING" variables to make them look like this:

      "COMPREHENSIVE_THEME_DIRS": [
          "/opt/bitnami/apps/edx/edx-platform/themes"
      ],
      ...
      "ENABLE_COMPREHENSIVE_THEMING": true,
    
  • To enable a default theme for CMS, open the /opt/bitnami/apps/edx/conf/cms.env.json file and perform the same changes described above.

Apply a default theme

  • Access the Django administration console (check the Django Admin Console instructions for more information).
  • Browse to "Theming -> Site themes -> Add site theme".
  • From the "Site menu", select the site you want to apply a theme to.
  • Enter the identifier of the theme (same as its directory name) and click on "Save". In the example below, the selected default theme is "red-theme".

    Add site and theme

    The theme will be enabled for the specified site as it is shown below:

    Theme enabled

Build assets for a custom theme

  • If you enabled the custom theme for LMS, update LMS assets:

     $ sudo /opt/bitnami/apps/edx/bin/edxapp-update-assets-lms
    
  • If you enabled the custom theme for CMS, update CMS assets:

     $ sudo /opt/bitnami/apps/edx/bin/edxapp-update-assets-cms
    
  • Restart the Apache server:

     $ sudo /opt/bitnami/ctlscript.sh restart apache
    

How to enable and apply a custom theme?

In order to enable and apply custom themes for edX, you need to follow these steps in the sequence shown:

Enable a custom theme

  • Place your theme in the /opt/bitnami/apps/edx/var/themes directory (example).
  • In order to enable a custom theme for LMS, modify the /opt/bitnami/apps/edx/conf/lms.env.json file and apply the following changes (example):

    • Set ENABLE_COMPREHENSIVE_THEMING to "true".
    • Add the absolute path of the themes directory to the COMPREHENSIVE_THEME_DIRS configuration property array.
  • In order to enable a custom theme for CMS, modify the /opt/bitnami/apps/edx/conf/cms.env.json file and apply the following changes (example):

    • Set ENABLE_COMPREHENSIVE_THEMING to "true".
    • Add the absolute path of the themes directory to the COMPREHENSIVE_THEME_DIRS configuration property array.

Example settings for an edX theme

Custom theme folder structure

Themes should have the following folder structure:

-/opt/bitnami/apps/edx/var/themes
  |-my-custom-theme/
    |-cms/
      |-static/
      |-templates/
    |-lms/
      |-static/
      |-templates/
Custom theme configuration

The lms.env.json and cms.env.json configuration files should contain the following:

"COMPREHENSIVE_THEME_DIRS": [
    "/opt/bitnami/apps/edx/edx-platform/themes",
    "/opt/bitnami/apps/edx/var/themes"
],
"ENABLE_COMPREHENSIVE_THEMING": true,

Apply a custom theme

  • Access the Django administration console (check the Django Admin Console instructions for more information).
  • Browse to "Theming -> Site themes -> Add site theme".
  • From the "Site menu", select the site you want to apply a theme to.
  • Enter the identifier of the theme (same as its directory name) and click on "Save".

    Add site and theme

    The theme will be enabled for the specified site as it shown below:

    Theme enabled

Build assets for a custom theme

  • If you enabled the custom theme for LMS, update LMS assets:

     $ sudo /opt/bitnami/apps/edx/bin/edxapp-update-assets-lms
    
  • If you enabled the custom theme for CMS, update CMS assets:

     $ sudo /opt/bitnami/apps/edx/bin/edxapp-update-assets-cms
    
  • Restart the Apache server:

     $ sudo /opt/bitnami/ctlscript.sh restart apache
    

How to configure outbound email settings?

Custom SMTP account or Gmail

Follow these steps:

  • Log in to the server console.

  • Navigate to the /opt/bitnami/apps/edx/conf directory.

  • Edit the files lms.env.json and cms.env.json and modify the lines below. For example, for a Gmail account, use the settings below. Replace USERNAME with your Gmail account username.

     "EMAIL_HOST": "smtp.gmail.com",
     "EMAIL_PORT": 587,
     "EMAIL_USE_TLS": true,
     "DEFAULT_FROM_EMAIL": "USERNAME@gmail.com",
    
  • Add the credentials to the lms.auth.json and cms.auth.json files. Replace USERNAME and PASSWORD with your Gmail account username and password respectively.

     "EMAIL_HOST": "smtp.gmail.com",
     "EMAIL_PORT": 587,
     "EMAIL_USE_TLS": true,
     "EMAIL_HOST_USER": "USERNAME@gmail.com",
     "EMAIL_HOST_PASSWORD": "PASSWORD",
    
  • Restart the Apache server to load the changes.

To configure the application to use other third-party SMTP services for outgoing email, such as SendGrid or Mandrill, refer to the FAQ.

NOTE: If you are using Gmail as the outbound email server and have experienced issues trying to send emails correctly, check the How to troubleshoot Gmail SMTP issues to learn the causes of these issues and how to solve them.

How to create a full backup of Open edX?

Backup

The Open edX powered by Bitnami is self-contained and the simplest option for performing a backup is to copy or compress the Bitnami stack installation directory. To do so in a safe manner, you will need to stop all servers, so this method may not be appropriate if you have people accessing the application continuously.

Follow these steps:

  • Change to the directory in which you wish to save your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Create a compressed file with the stack contents:

      $ sudo tar -pczvf application-backup.tar.gz /opt/bitnami
    
  • Restart all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

You should now download or transfer the application-backup.tar.gz file to a safe location.

Restore

Follow these steps:

  • Change to the directory containing your backup:

      $ cd /your/directory
    
  • Stop all servers:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Move the current stack to a different location:

      $ sudo mv /opt/bitnami /tmp/bitnami-backup
    
  • Uncompress the backup file to the original directoryv

      $ sudo tar -pxzvf application-backup.tar.gz -C /
    
  • Start all servers:

      $ sudo /opt/bitnami/ctlscript.sh start
    

If you want to create only a database backup, refer to these instructions for MySQL and PostgreSQL.

How to upgrade edX?

NOTE: Before proceeding to upgrade the Bitnami edX stack, ensure that you have performed a complete backup.
IMPORTANT: In order to upgrade any edX Ficus version to edX Ginkgo, you must first upgrade to edX Ficus.4

Upgrade edX Ficus.4 to Gingko

NOTE: This section assumes that you wish to upgrade to Ginkgo.2, but the steps below are valid for any Ginkgo version.

To upgrade edX Ficus.4 to Gingko.2, follow these steps:

  • Load the Bitnami stack environment, if it is not already loaded:

      $ sudo /opt/bitnami/use_edx
      $ . /opt/bitnami/scripts/setenv.sh
    
  • Stop all edX services:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Install the GCC compiler.

    On Debian/Ubuntu, run the commands below:

      $ sudo apt-get update
      $ sudo apt-get install gcc g++
    

    On RHEL/CentOS, run the commands below:

      $ sudo yum group install "Development Tools"
    
  • Navigate to the application directory at /opt/bitnami/apps/edx/edx-platform and save the current state of the Git repository:

      $ cd /opt/bitnami/apps/edx/edx-platform
      $ git diff -- . ':!requirements' > ~/bitnami_edx-platform_changes.txt
    
  • Check out the Gingko.2 branch and apply the Bitnami changes to the Git repository:

      $ git fetch
      $ git checkout -f open-release/ginkgo.2
      $ git apply ~/bitnami_edx-platform_changes.txt
    
  • Install the necessary modules:

      $ npm install
    
  • Install edX's Python dependencies in this order:

      $ . ../venvs/edxapp/bin/activate
      $ pip install -r --exists-action=w requirements/edx/setuptools.txt
      $ pip install -r --exists-action=w requirements/edx/pre.txt
      $ pip install -r --exists-action=w requirements/edx/github.txt
      $ pip install -r --exists-action=w requirements/edx/local.txt
      $ pip install -r --exists-action=w requirements/edx/base.txt
      $ pip install -r --exists-action=w requirements/edx/paver.txt
      $ pip install -r --exists-action=w requirements/edx/post.txt
      $ deactivate
    
  • Install edX Sandbox's Python dependencies and fix ownerships:

      $ . ../venvs/edxapp-sandbox/bin/activate
      $ sudo pip install -r requirements/edx-sandbox/setuptools.txt
      $ sudo pip install -r requirements/edx-sandbox/base.txt --ignore-installed
      $ sudo pip install -r requirements/edx-sandbox/local.txt
      $ sudo pip install -r requirements/edx-sandbox/post.txt
      $ deactivate
      $ sudo chown -R sandbox:sandbox ../venvs/edxapp-sandbox/
    
  • Start databases:

      $ sudo /opt/bitnami/ctlscript.sh start mysql
      $ sudo /opt/bitnami/ctlscript.sh start mongodb
      $ sudo /opt/bitnami/ctlscript.sh start memcached
      $ sudo /opt/bitnami/ctlscript.sh start rabbitmq
      $ sudo /opt/bitnami/ctlscript.sh start elasticsearch
    
  • Update edX assets. Note that this may take a significant amount of time for each step:

      $ ../bin/edxapp-update-assets-cms
      $ ../bin/edxapp-update-assets-lms
    
  • Drop the djcelery database tables:

      $ sudo ../bin/python.edxapp manage.py lms drop_djcelery_tables --settings=aws
    
  • Run edX migrations (this may also take some time):

      $ sudo ../bin/edxapp-migrate-cms
      $ sudo ../bin/edxapp-migrate-lms
    
  • Fix log file ownership:

      $ sudo chown -R daemon:daemon /opt/bitnami/apps/edx/var/log
    
  • Edit the /opt/bitnami/apps/edx/scripts/ctl-edx-celery-workers.sh script and replace this:

      start_worker() {
          ...
      }
    

    with this:

      start_worker() {
          EDX_HOME="/opt/bitnami/apps/edx"
          cd $EDX_HOME/edx-platform
          APP=$(echo $1 | cut -d. -f2)
          ADDITIONAL_PARAMS=""
          if [ "$APP" = "cms" ]; then
              ADDITIONAL_PARAMS="-I contentstore.tasks"
          fi
          if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ]; then
              su -s /bin/sh daemon -c "$EDX_HOME/bin/python.edxapp ./manage.py $APP --settings=aws celery worker $ADDITIONAL_PARAMS --loglevel=info --queues=$1 --hostname=$1.%h --concurrency=$2 > $EDX_HOME/var/log/celery/$1.log 2>&1 &"
          else
              $EDX_HOME/bin/python.edxapp ./manage.py $APP --settings=aws celery worker $ADDITIONAL_PARAMS --loglevel=info --queues=$1 --hostname=$1.%h --concurrency=$2 > $EDX_HOME/var/log/celery/$1.log 2>&1 &
          fi
          cd - > /dev/null
      }
    
  • Edit the lms.env.json file and edit the CELERY_QUEUES section so that it looks like this:

      "CELERY_QUEUES": [
          "edx.lms.core.low",
          "edx.lms.core.default",
          "edx.lms.core.high",
          "edx.lms.core.high_mem"
      ],
      ...
    
  • Upgrade xqueue:

      $ cd /opt/bitnami/apps/xqueue/xqueue
      $ git diff -- . ':!*requirements.txt' ':!xqueue/test_settings.py' > ~/bitnami_xqueue_changes.txt
      $ git fetch
      $ git checkout -f open-release/ginkgo.2
      $ git apply ~/bitnami_xqueue_changes.txt
    
  • Migrate and update users:

      $ sudo ../bin/django-admin.xqueue migrate --noinput
      $ sudo ../bin/django-admin.xqueue update_users
    
  • Upgrade the comments service:

      $ cd /opt/bitnami/apps/forum/cs_comments_service
      $ git fetch
      $ git checkout -f open-release/ginkgo.2
      $ sed -i 's/^ruby ".*"$//' Gemfile
      $ bundle install
    
  • Start the remaining services:

      $ sudo /opt/bitnami/ctlscript.sh start apache
      $ sudo /opt/bitnami/ctlscript.sh start edx
      $ sudo /opt/bitnami/ctlscript.sh start xqueue
    

Your Bitnami edX stack should now be upgraded to Gingko.2. Confirm that the upgrade was successful by logging into edX and verifying the integrity of your data.

Upgrade edX Ficus to Ficus.4

To upgrade edX Ficus to Ficus.4, follow these steps:

  • Load the Bitnami stack environment, if it is not already loaded:

      $ sudo /opt/bitnami/use_edx
      $ . /opt/bitnami/scripts/setenv.sh
    
  • Stop all edX services:

      $ sudo /opt/bitnami/ctlscript.sh stop
    
  • Install the GCC compiler.

    On Debian/Ubuntu, run the commands below:

      $ sudo apt-get update
      $ sudo apt-get install gcc g++
    

    On RHEL/CentOS, run the commands below:

      $ sudo yum group install "Development Tools"
    
  • Navigate to the application directory at /opt/bitnami/apps/edx/edx-platform and save the current state of the Git repository:

      $ cd /opt/bitnami/apps/edx/edx-platform
      $ git diff -- . ':!requirements' > ~/bitnami_edx-platform_changes.txt
    
  • Check out the Ficus.4 branch and apply the Bitnami changes to the Git repository:

      $ git fetch
      $ git checkout -f open-release/ficus.4
      $ git apply ~/bitnami_edx-platform_changes.txt
    
  • Install the necessary modules:

      $ npm install
    
  • Install edX's Python dependencies in this order:

      $ . ../venvs/edxapp/bin/activate
      $ pip install -r --exists-action=w requirements/edx/setuptools.txt
      $ pip install -r --exists-action=w requirements/edx/pre.txt
      $ pip install -r --exists-action=w requirements/edx/github.txt
      $ pip install -r --exists-action=w requirements/edx/local.txt
      $ pip install -r --exists-action=w requirements/edx/base.txt
      $ pip install -r --exists-action=w requirements/edx/paver.txt
      $ pip install -r --exists-action=w requirements/edx/post.txt
      $ deactivate
    
  • Install edX Sandbox's Python dependencies and fix ownerships:

      $ . ../venvs/edxapp-sandbox/bin/activate
      $ sudo pip install -r requirements/edx-sandbox/setuptools.txt
      $ sudo pip install -r requirements/edx-sandbox/base.txt --ignore-installed
      $ sudo pip install -r requirements/edx-sandbox/local.txt
      $ sudo pip install -r requirements/edx-sandbox/post.txt
      $ deactivate
      $ sudo chown -R sandbox:sandbox ../venvs/edxapp-sandbox/
    
  • Start databases:

      $ sudo /opt/bitnami/ctlscript.sh start mysql
      $ sudo /opt/bitnami/ctlscript.sh start mongodb
      $ sudo /opt/bitnami/ctlscript.sh start memcached
      $ sudo /opt/bitnami/ctlscript.sh start rabbitmq
      $ sudo /opt/bitnami/ctlscript.sh start elasticsearch
    
  • Update edX assets. Note that this may take a significant amount of time for each step:

      $ ../bin/edxapp-update-assets-cms
      $ ../bin/edxapp-update-assets-lms
    
  • Run edX migrations (this may also take some time):

      $ sudo ../bin/edxapp-migrate-cms
      $ sudo ../bin/edxapp-migrate-lms
    
  • Fix log file ownership:

      $ sudo chown -R daemon:daemon /opt/bitnami/apps/edx/var/log
    
  • Edit the /opt/bitnami/apps/edx/scripts/ctl-edx-celery-workers.sh script and replace this:

      start_worker() {
          ...
      }
    

    with this:

      start_worker() {
          EDX_HOME="/opt/bitnami/apps/edx"
          cd $EDX_HOME/edx-platform
          APP=$(echo $1 | cut -d. -f2)
          ADDITIONAL_PARAMS=""
          if [ "$APP" = "cms" ]; then
              ADDITIONAL_PARAMS="-I contentstore.tasks"
          fi
          if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ]; then
              su -s /bin/sh daemon -c "$EDX_HOME/bin/python.edxapp ./manage.py $APP --settings=aws celery worker $ADDITIONAL_PARAMS --loglevel=info --queues=$1 --hostname=$1.%h --concurrency=$2 > $EDX_HOME/var/log/celery/$1.log 2>&1 &"
          else
              $EDX_HOME/bin/python.edxapp ./manage.py $APP --settings=aws celery worker $ADDITIONAL_PARAMS --loglevel=info --queues=$1 --hostname=$1.%h --concurrency=$2 > $EDX_HOME/var/log/celery/$1.log 2>&1 &
          fi
          cd - > /dev/null
      }
    
  • Edit the lms.env.json file and edit the CELERY_QUEUES section so that it looks like this:

      "CELERY_QUEUES": [
          "edx.lms.core.low",
          "edx.lms.core.default",
          "edx.lms.core.high",
          "edx.lms.core.high_mem"
      ],
    
  • Start remaining services:

      $ sudo /opt/bitnami/ctlscript.sh start apache
      $ sudo /opt/bitnami/ctlscript.sh start edx
    

Your Bitnami edX stack should now be upgraded to Ficus.4. Confirm that the upgrade was successful by logging into edX and verifying the integrity of your data.

How to create an SSL certificate?

OpenSSL is required to create an SSL certificate. A certificate request can then be sent to a certificate authority (CA) to get it signed into a certificate, or if you have your own certificate authority, you may sign it yourself, or you can use a self-signed certificate (because you just want a test certificate or because you are setting up your own CA).

Follow the steps below:

  • Generate a new private key:

     $ sudo openssl genrsa -out /opt/bitnami/apache2/conf/server.key 2048
    
  • Create a certificate:

     $ sudo openssl req -new -key /opt/bitnami/apache2/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr
    
    IMPORTANT: Enter the server domain name when the above command asks for the "Common Name".
  • Send cert.csr to the certificate authority. When the certificate authority completes their checks (and probably received payment from you), they will hand over your new certificate to you.

  • Until the certificate is received, create a temporary self-signed certificate:

     $ sudo openssl x509 -in /opt/bitnami/apache2/conf/cert.csr -out /opt/bitnami/apache2/conf/server.crt -req -signkey /opt/bitnami/apache2/conf/server.key -days 365
    
  • Back up your private key in a safe location after generating a password-protected version as follows:

     $ sudo openssl rsa -des3 -in /opt/bitnami/apache2/conf/server.key -out privkey.pem
    

    Note that if you use this encrypted key in the Apache configuration file, it will be necessary to enter the password manually every time Apache starts. Regenerate the key without password protection from this file as follows:

     $ sudo openssl rsa -in privkey.pem -out /opt/bitnami/apache2/conf/server.key
    

Find more information about certificates at http://www.openssl.org.

How to enable HTTPS support with SSL certificates?

TIP: If you wish to use a Let's Encrypt certificate, you will find specific instructions for enabling HTTPS support with Let's Encrypt SSL certificates in our Let's Encrypt guide.
NOTE: The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your cloud server.

Bitnami images come with SSL support already pre-configured and with a dummy certificate in place. Although this dummy certificate is fine for testing and development purposes, you will usually want to use a valid SSL certificate for production use. You can either generate this on your own (explained here) or you can purchase one from a commercial certificate authority.

Once you obtain the certificate and certificate key files, you will need to update your server to use them. Follow these steps to activate SSL support:

  • Use the table below to identify the correct locations for your certificate and configuration files.

    Variable Value
    Current application URL https://[custom-domain]/
      Example: https://my-domain.com/ or https://my-domain.com/appname
    Apache configuration file /opt/bitnami/apache2/conf/bitnami/bitnami.conf
    Certificate file /opt/bitnami/apache2/conf/server.crt
    Certificate key file /opt/bitnami/apache2/conf/server.key
    CA certificate bundle file (if present) /opt/bitnami/apache2/conf/server-ca.crt
  • Copy your SSL certificate and certificate key file to the specified locations.

    NOTE: If you use different names for your certificate and key files, you should reconfigure the SSLCertificateFile and SSLCertificateKeyFile directives in the corresponding Apache configuration file to reflect the correct file names.
  • If your certificate authority has also provided you with a PEM-encoded Certificate Authority (CA) bundle, you must copy it to the correct location in the previous table. Then, modify the Apache configuration file to include the following line below the SSLCertificateKeyFile directive. Choose the correct directive based on your scenario and Apache version:

    Variable Value
    Apache configuration file /opt/bitnami/apache2/conf/bitnami/bitnami.conf
    Directive to include (Apache v2.4.8+) SSLCACertificateFile "/opt/bitnami/apache2/conf/server-ca.crt"
    Directive to include (Apache < v2.4.8) SSLCertificateChainFile "/opt/bitnami/apache2/conf/server-ca.crt"
    NOTE: If you use a different name for your CA certificate bundle, you should reconfigure the SSLCertificateChainFile or SSLCACertificateFile directives in the corresponding Apache configuration file to reflect the correct file name.
  • Once you have copied all the server certificate files, you may make them readable by the root user only with the following commands:

     $ sudo chown root:root /opt/bitnami/apache2/conf/server*
    
     $ sudo chmod 600 /opt/bitnami/apache2/conf/server*
    
  • Open port 443 in the server firewall. Refer to the FAQ for more information.

  • Restart the Apache server.

You should now be able to access your application using an HTTPS URL.

How to force HTTPS redirection with Apache?

Edit the configuration file /opt/bitnami/apps/edx/conf/httpd-lms.conf and find the lines containing rewrite rules. Typically, it will look like this:

# Enable some basic redirections
RewriteEngine On
RewriteRule ^/edx-studio(/.*)? http://%{SERVER_NAME}:18010/ [R,L]

Update the above content with additional rules to force HTTPS redirection, so that it looks like this:

# Enable some basic redirections
RewriteEngine On
RewriteRule ^/edx-studio(/.*)? http://%{SERVER_NAME}:18010/ [R,L]
# Force HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

After modifying the Apache configuration files, restart Apache to apply the changes.

How to debug Apache errors?

Once Apache starts, it will create two log files at /opt/bitnami/apache2/logs/access_log and /opt/bitnami/apache2/logs/error_log respectively.

  • The access_log file is used to track client requests. When a client requests a document from the server, Apache records several parameters associated with the request in this file, such as: the IP address of the client, the document requested, the HTTP status code, and the current time.

  • The error_log file is used to record important events. This file includes error messages, startup messages, and any other significant events in the life cycle of the server. This is the first place to look when you run into a problem when using Apache.

If no error is found, you will see a message similar to:

Syntax OK

How to find the MySQL database credentials?

How to connect to the MySQL database?

You can connect to the MySQL database from the same computer where it is installed with the mysql client tool.

$ mysql -u root -p

You will be prompted to enter the root user password. This is the same as the application password.

How to debug errors in your database?

The main log file is created at /opt/bitnami/mysql/data/mysqld.log on the MySQL database server host.

How to change the MySQL root password?

You can modify the MySQL password using the following command at the shell prompt. Replace the NEW_PASSWORD placeholder with the actual password you wish to set.

$ /opt/bitnami/mysql/bin/mysqladmin -p -u root password NEW_PASSWORD

How to reset the MySQL root password?

If you don't remember your MySQL root password, you can follow the steps below to reset it to a new value:

  • Create a file in /home/bitnami/mysql-init with the content shown below (replace NEW_PASSWORD with the password you wish to use):

     UPDATE mysql.user SET Password=PASSWORD('NEW_PASSWORD') WHERE User='root';
     FLUSH PRIVILEGES;
    

    If your stack ships MySQL v5.7.x, use the following content instead of that shown above:

     UPDATE mysql.user SET authentication_string=PASSWORD('NEW_PASSWORD') WHERE User='root';
     FLUSH PRIVILEGES;
    
    TIP: Check the MySQL version with the command /opt/bitnami/mysql/bin/mysqladmin --version or /opt/bitnami/mysql/bin/mysqld --version.
  • Stop the MySQL server:

     $ sudo /opt/bitnami/ctlscript.sh stop mysql
    
  • Start MySQL with the following command:

     $ sudo /opt/bitnami/mysql/bin/mysqld_safe --pid-file=/opt/bitnami/mysql/data/mysqld.pid --datadir=/opt/bitnami/mysql/data --init-file=/home/bitnami/mysql-init 2> /dev/null &
    
  • Restart the MySQL server:

     $ sudo /opt/bitnami/ctlscript.sh restart mysql
    
  • Remove the script:

     $ rm /home/bitnami/mysql-init
    

How to find the MongoDB database credentials?

How to connect to the MongoDB database?

You can connect to the MongoDB database from the same computer where it is installed. Run the mongo client authenticating as the root user against the admin database:

$ mongo admin --username root -p

You will be prompted to enter the root user password. This is the same as the application password.

How to debug errors in your MongoDB database?

The main log file is created at /opt/bitnami/mongodb/log/mongodb.log on the MongoDB database server host.

How to debug RabbitMQ errors?

To debug RabbitMQ's errors, check the log files of RabbitMQ at /opt/bitnami/rabbitmq/var.

How to upload files to the server with SFTP?

Although you can use any SFTP/SCP client to transfer files to your server, the link below explains how to configure FileZilla (Windows, Linux and Mac OS X), WinSCP (Windows) and Cyberduck (Mac OS X). It is required to use your server's private SSH key to configure the SFTP client properly. Choose your preferred application and follow the steps in the link below to connect to the server through SFTP.

How to upload files to the server

Troubleshooting

Errors sending bulk email

You may encounter errors sending bulk email from the instructor tab. This is usually because the bulk email subsystem requires the Lynx plaintext browser to convert HTML email to plaintext (discussed at https://github.com/edx/edx-platform/wiki/Bulk-Email#required-packages).

To resolve this, install the Lynx browser using the command below:

  • Debian:

    $ sudo apt-get install lynx

  • CentOS:

    $ sudo yum install lynx

How to debug errors in Open edX?

NOTE: This section describes the log files location for the edX Eucalyptus release. If you are using a prior version, find the log files at /opt/bitnami/apps/edx/edxapp/log/.

The Open edX log files are stored at different paths depending on the service:

  • edX platform log files are stored at /opt/bitnami/apps/edx/var/log/.
  • XQueue log files are stored at /opt/bitnami/apps/xqueue/var/log/.

By default, both services are configured with a "local" log level. If you want to increase the log level on each service in order to debug your application, you need to follow the steps below:

  • Open the log configuration files with an editor. Depending on the service, you will find that files at:

    • edx platform: /opt/bitnami/apps/edx/conf/cms.env.json and /opt/bitnami/apps/edx/conf/lms.env.json.
    • XQueue: /opt/bitnami/apps/xqueue/conf/xqueue.env.json.
  • Substitute the value:

    "LOCAL_LOGLEVEL": "INFO",
    
  • with:

    "LOCAL_LOGLEVEL": "DEBUG",
    
  • Restart the Apache server to load the changes.

How to run paver, django-admin and python commands in the Bitnami Open edX stack?

NOTE: This section describes the command location for the edX Eucalyptus release. If you are using a prior version, find the commands at /opt/bitnami/apps/edx/edx-platform/bin/.

Depending on the application you want to manage (edX Platform or XQueue), there are a list of scripts available to run these commands with a pre-configured environment for the application. The available scripts for each application are listed below:

  • Option 1: edX platform
  • Option 2: XQueue

edX Platform

Paver and Python commands are located in the /opt/bitnami/apps/edx/bin directory.

For example, to update your database using Python, you will need to execute these commands:

$ cd /opt/bitnami/apps/edx/edx-platform
$ sudo /opt/bitnami/apps/edx/bin/python.edxapp ./manage.py lms syncdb --migrate --settings aws
$ sudo /opt/bitnami/apps/edx/bin/python.edxapp ./manage.py cms syncdb --migrate --settings aws

XQueue

Django-Admin and Python commands are located in the /opt/bitnami/apps/xqueue/bin directory.

For example, to update your database using django-admin, you will need to execute these commands:

$ sudo /opt/bitnami/apps/xqueue/bin/django-admin.xqueue syncdb --migrate --settings xqueue.bitnami_settings

How to configure the Preview button in Studio?

NOTE: The properties PREVIEW_LMS_BASE and LMS_BASE must be configured with different domains. Otherwise, non-staff users won't be able to see any course when navigating your site.

To enable content previews in Studio, you need to configure the Preview button. Follow these steps:

  • Make sure that you have a subdomain or a different domain pointing to your Open edX server.
  • Navigate to the /opt/bitnami/apps/edx/conf directory.
  • Modify the lms.env.json and cms.env.json files and set PREVIEW_LMS_BASE to your alternative domain:

     "PREVIEW_LMS_BASE": "preview.yourdomain.com",
    
  • Restart all services running the commnand below:

     $ sudo /opt/bitnami/ctlscript.sh restart
    

How to enable an XBlock for a course?

For Cypress, Dogwood, Eucalyptus and higher versions of edX

Cypress and Dogwood versions include the Google Drive, MS File Storage and Office Mix XBlocks. The Eucalyptus version includes the XBlocks below:

To install a different XBlock, follow these steps:

  • Log in to your server console.

  • Download the module.

  • Load the Open edX virtual environment:

     $ source /opt/bitnami/apps/edx/venvs/edxapp/bin/activate
    
NOTE: Since the Eucalyptus version, the Bitnami Open edX Stack structure has changed significantly. If you are using a prior version, load the environment by running the command: source /opt/bitnami/apps/edx/edx-platform/venv/bin/activate
  • Install the XBlock using pip:

     $ sudo pip install /path/to/downloaded/xblock/
    
NOTE: The installation steps could differ depending on the XBlock. Check the provider documentation to get more information.
  • Restart the Apache server to load the changes.

Next, enable the XBlock for the course, as follows:

  • Navigate to the course in Studio.

  • Click the "Settings -> Advanced settings" menu.

  • Specify the XBlock to use in the "Advanced Module List" area using a comma-separated list. Note that you can find the name of the module in the provider documentation.

    XBlock configuration

You should now be able to use the extension. To check this, create a new unit and select the "Advanced" button:

XBlock usage

You should see the modules previously specified:

XBlock usage

For Birch versions of edX

Follow these steps:

  • Enable the advanced modules. Edit the file located at /opt/bitnami/apps/edx/edx-platform/cms/envs/common.py and set the value of the ALLOW_ALL_ADVANCED_COMPONENTS variable to "True".

  • Restart the Apache server to load the changes.

How to enable Third-Party Authentication?

Open edX Platform allows you to integrate third-party authentication with two kind of authentication providers:

This section describes how to integrate the Bitnami Open edX with two of the most popular OAuth2 providers: Google and Facebook.

Previous Steps

Integrate edX with Google

Step 1: Register the Open edX site with Google
  • Navigate to the Google Developers Console.
  • Select an existing project or create a new one.
  • Search for the "Google+ API service" in the Google APIs list and press the "Enable API" button.
  • Under "API Manager" sidebar, select "Credentials -> OAuth consent" screen tab.
  • Select "Create credentials", and then select "OAuth client ID".
  • For Application type, select "Web application", choose a "Name" for your client ID and leave the "Authorized JavaScript origins" field blank.
  • Fill the "Authorized redirect URI" field with the value http://SERVER-IP/auth/complete/google-oauth2/. SERVER-IP is a placeholder, please, replace it with the actual domain of your Open edX server.
  • Press the "Create" button and note down "Client ID" and the "Client secret".
Step 2: Configure Open edX
  • Log in to the server console.
  • Navigate to the /opt/bitnami/apps/edx/conf directory.
  • Modify the lms.env.json file and set FEATURES.ENABLE_THIRD_PARTY_AUTH and FEATURES.ENABLE_COMBINED_LOGIN_REGISTRATION to True.
  • Modify the lms.auth.json file and set SOCIAL_AUTH_OAUTH_SECRETS as described below:
NOTE: Remember to replace the CLIENT_SECRET placeholder in the example below with the Client secret you noted down previously.
      "SOCIAL_AUTH_OAUTH_SECRETS": {
          "google-oauth2": "CLIENT_SECRET"
      }
  • Restart all servers using the graphical manager or the command-line script:

       $ sudo /opt/bitnami/ctlscript.sh restart
    
  • Access the Django administration console (check the Django Admin Console instructions for more information).
  • Browse to "Third Party Auth -> Provider Configuration (OAuth2)".
  • Select "Add Provider Configuration (OAuth)".
  • Mark "Enabled" and "Visible" checkbox.
  • Set "Icon Class" to "fa-google-plus".
  • Set "Name" to "Google".
  • Set "Backend Name" and "Provider slug" to "google-oauth2".
  • Set "Client ID" to the "Client ID" you noted down previosuly and leave the "Client secret" field blank.
  • Click the "Save" button.

Integrate edX with Facebook

Step 1: Register the Open edX site with Google
  • Sign in to Facebook, then go to the Facebook for Developers page.
  • Select "Add a New App".
  • Enter a name for the app and mail address, and then select "Create New Facebook App ID".
  • Browse to "Settings -> Basic".
  • Note down the "App ID" and "App Secret".
  • In the "App Domains field", enter the actual domain of your Open edX server.
  • Select "Add Platform", and then select "Website".
  • Fill the "Site URI" field with the value http://SERVER-IP/. SERVER-IP is a placeholder, please, replace it with the actual domain of your Open edX server.
  • Click "Save Changes" button.
Step 2: Configure Open edX
  • Log in to the server console.
  • Navigate to the /opt/bitnami/apps/edx/conf directory.
  • Modify the lms.env.json file and set FEATURES.ENABLE_THIRD_PARTY_AUTH and FEATURES.ENABLE_COMBINED_LOGIN_REGISTRATION to True.
  • Modify the lms.auth.json file and set SOCIAL_AUTH_OAUTH_SECRETS as described below:
NOTE: Remember to replace the CLIENT_SECRET placeholder in the example below with the Client secret you noted down previously.
      "SOCIAL_AUTH_OAUTH_SECRETS": {
          "facebook": "CLIENT_SECRET"
      }
  • Restart all servers using the graphical manager or the command-line script:

       $ sudo /opt/bitnami/ctlscript.sh restart
    
  • Access the Django administration console (check the Django Admin Console instructions for more information).
  • Browse to "Third Party Auth -> Provider Configuration (OAuth2)".
  • Select "Add Provider Configuration (OAuth)".
  • Mark "Enabled" and "Visible" checkbox.
  • Set "Icon Class" to "fa-facebook".
  • Set "Name" to "Facebook".
  • Set "Backend Name" and "Provider slug" to "facebook".

    IMPORTANT: Remember that both the "Name" and the "Backend Name" fields must match.
  • Set "Client ID" to the "Client ID" you noted down previosuly and leave the "Client secret" field blank.
  • Click the "Save" button.

How to install CodeJail Sandbox?

CodeJail manages the execution of untrusted code in secure sandboxes. It is designed primarily for Python execution, but can be used for other languages as well.

A CodeJail sandbox consists of several pieces:

  • Sandbox environment: Language setup (e.g. Python) and associated core packages.
  • Sandbox packages: Additional packages needed for a given run.
  • Untrusted packages: Code and data submitted by students to be tested on the server.
  • OS packages: System libraries needed to run the language (e.g. Python).

Visit the CodeJail official documentation to learn more about CodeJail.

Since the Eucalyptus version, a CodeJail sandbox enforced with AppArmor is already included in the Open edX Stack. You can find it in /opt/bitnami/apps/edx/venvs/edxapp-sandbox.

How to execute edX Comments Service (Forum) tests?

You can use the rspec in order to test a setup of edX Forum for integration tests.

Required gems installation

Before executing the tests, it's necessary to run bundle install to install some missing gems. Install them running the commands below:

$ cd /opt/bitnami/apps/forum/cs_comments_service
$ bundle install --with test

Test execution

To run the test suite, use:

$ cd /opt/bitnami/apps/forum/cs_comments_service
$ bundle exec bin/rspec

How to run XQueue tests?

NOTE: This functionality is only available in the Eucalyptus version and better.

You can use the Integration Test Framework in order to test a setup of XQueue for integration tests.

Configuration

Tests use the configuration parameters defined at /opt/bitnami/apps/xqueue/conf/xqueue.test_env.json. Tests that require authentication to run should raise a SkipTest exception if the authentication information is not provided.

The Bitnami Open edX Stack is already configured to test XQueue with RabbitMQ integration. However, you need to edit the configuration JSON file in order to test Mathworks integration since authentication information is not provided.

Test execution

To run the test suite, use:

$ sudo /opt/bitnami/apps/xqueue/bin/python.xqueue manage.py test --settings xqueue.test_settings --noinput
bch

Bitnami Documentation