Learn pro tips on how to configure the Open edX platform. This tutorial will help you to better understand the organizational strategy behind the many Open edx  platform configuration files. You’ll also learn about the platform architecture and how the file system is organized.

Summary

Updated January 19, 2021 for the Open edX Koa release.

Open edX is a highly configurable, modular platform. In fact, there are well more than a thousand configuration parameters that you can use to tailor the functionality, behavior and infrastructure plan for your project. With some cursory knowledge of the Open edX platform architecture you’ll be able to use intuition and common sense to find the parameters that you need in order to tailor the platform to your needs. I have attempted to organize this article so that you can grab the information that you need as quickly as possible, only reading as much of the content as you really need to.

Note that this article focuses on “Application Configuration“. That is, how to modify application parameters and feature flags for the LMS and CMS. There are many other aspects of the Open edX platform that are also customizable using the same basic approach. The aspects of Open edX on which I spend most of my time are as follows.

  • Application Configuration

  • Site Theming

  • Horizontal Scaling

  • Nginx configuration

  • Certificate Server Configuration

  • E-commerce setup

A Practical Example

Let’s use the built-in Linux text editor Vim to set the platform display name. If you’re unfamiliar with Vim then this 8-minute video will teach you enough to get through this step of the tutorial.

# Step 1: Edit the LMS configuration file
sudo vim /edx/etc/lms.yml
# Find the parameter, "PLATFORM_NAME: : Your Platform Name Here" 
# located on or around row 465.
# Replace the text "Your Platform Name Here" 
# with a more appropriate name for your Open edX platform.

# Step 2: Reload the LMS configuration parameters.
sudo /edx/app/edxapp/reload_lms_config.sh

# Step 3: Check your work. Open the LMS in a browser window. 
# In the footer of the landing page you should see the text, 
# "© [YOUR NEW PLATFORM NAME]. All rights reserved except where noted. edX, Open edX and their respective logos are registered trademarks of edX Inc."

Pro Tips

1. ) lms.yml has most of what you need. The vast majority of the configuration parameters that you will need are located in the file /edx/etc/lms.yml, so take the time to learn about the contents of this file. lms.yml (and it’s cms.yml counterpart) contains 600 lines of alphabetized parameters that cover topics including: application feature flags, display names, SMTP email configuration and email addresses, connection settings for databases and caches, security passwords, CSRF and CORS parameters, names of browser cookies, custom theming parameters, and more.

2.) Maintain your configuration data offline. Rather than editing files directly on the server with Vim as I’ve shown in the exercise above, I store my configuration data in Github, and I use VS Code on my development workstation to edit the files. This not only gives you control over versions but also allows you the luxury of better real-time syntax checking and color formatting to help you to work better and faster.

3.) Keep it simple. Most likely you can tailor your Open edX platform to your specific needs using only the parameters included in the yaml files in /edx/etc/. Therefore, I’d recommend avoiding any other configuration methodologies and techniques that you might encounter in the official Open edX documentation. It is unlikely that you need to fork the edx/edx-platform repository for example, in which case you definitely do not need to use server-vars.yml. Devstack is not necessary, nor is Vagrant, nor is Docker.

Commonly Modified Files

Aside from custom theming, most of the other work that I do on Open edX projects only involves a dozen or so files. I’m presenting these in order of importance, meaning, the frequency with which I find myself editing each file.

edX platform These are the yaml files located in /edx/etc/, and entail nearly all of the salient content of this article. In addition to configuration files for the LMS and CMS, you’ll also find the main configuration files for e-commerce, discovery and Insights.
Passwords The master passwords file is located in /home/ubuntu/my-passwords.yml and was generated as one of the very first steps of your native build installation process. The native build procedures are coded in Ansible, and the ansible playbooks reference this file dozens of times while building your platform. Note that the password values in my-passwords.yml are really only for your reference. Changing password values in this file is not only a terrible idea, but it also would have no direct affect on any of the Open edX platform nor its subsystems, unless you re-run the respective Ansible playbooks (which you probably should not attempt unless you really, really really know what you’re doing.
Nginx You’ll find one Nginx configuration file per site located in /edx/app/nginx/sites-available/. The files are deftly named. I modify the files “lms” and “cms” in this folder as part of installing SSL certificates to enable https. Less commonly, I also modify these files whenever I’m adding a load balancer.
Django settings Pursuant to section, “Open edX Configuration File Hierarchy” below, I occasionally need to add custom parameters to a platform. Again, this is rare, and you probably will not need to do this. In the case of the LMS, I only ever need to modify /edx/app/edxapp/edx-platform/lms/envs/production.py.

Open edX Configuration File Hierarchy

The LMS and CMS are traditional Python/Django projects and are organized accordingly. Both applications rely on a file named “production.py” that contains the principal application parameters. Consistent with Django best practice, these two applications include a lower level configuration file named “common.py” that contains parameter values that are “common” to various application stages such as “dev”, “test” and “production”.

In the case of Open edX however, we edited the file, “/edx/etc/lms.yml”, which is a practice that is unique to the Open edX project. This approach provides several benefits:

  • For a typical Open edX project, all of the configuration settings are consolidated into a single folder, /edx/etc/, simplifying configuration management.
  • It is not necessary to modify any Open edX platform source code.
  • It provides a more human friendly format — Yaml files in this case — to modify configuration data.
  • /edx/etc is an upgrade-friendly folder location. That is, your configuration work will not get overwritten during normal software upgrades.

Note that these files are read once, during application startup. Thus after modifying lms.yml or cms.yml you’ll need to either restart the platform or execute the built-in bash script to reload the parameters. These commands, respectively are as follows.

# to reload the configuration parameters without restarting
sudo /edx/app/edxapp/reload_lms_config.sh

# To restart the platform
/edx/bin/supervisorctl restart lms
/edx/bin/supervisorctl restart cms
/edx/bin/supervisorctl restart edxapp_worker:

# If you're running an older version of Open edX then use this command instead
#/edx/bin/supervisorctl restart edxapp:

lms.yml Parameters Of Interest

lms.yml contains around 400 parameters, however, I ignore most them. Following are the parameters that I actually modify, grouped by purpose and presented by order of priority.

[code lang=”yaml”]# platform name and description<br />
SITE_NAME: courses.school-of-rock.edu<br />
LMS_BASE: courses.school-of-rock.edu<br />
CMS_BASE: cms.school-of-rock.edu<br />
PLATFORM_NAME: Your Platform Name Here<br />
PLATFORM_DESCRIPTION: Your Platform Description Here<br />
STUDIO_NAME: Studio<br />
STUDIO_SHORT_NAME: Studio<br />
LMS_INTERNAL_ROOT_URL: http://courses.school-of-rock.edu<br />
LMS_ROOT_URL: http://courses.school-of-rock.edu<br />
ENTERPRISE_API_URL: http://courses.school-of-rock.edu/enterprise/api/v1<br />
ENTERPRISE_ENROLLMENT_API_URL: http://courses.school-of-rock.edu/api/enrollment/v1/<br />
LEARNER_PORTAL_URL_ROOT: https://learner-portal-courses.school-of-rock.edu<br />
PLATFORM_FACEBOOK_ACCOUNT: http://www.facebook.com/YourPlatformFacebookAccount<br />
PLATFORM_TWITTER_ACCOUNT: ‘@YourPlatformTwitterAccount’</p>
<p># Inbound email addresses<br />
# Note that i use the same email address for everything.<br />
ACTIVATION_EMAIL_SUPPORT_LINK: ”<br />
API_ACCESS_FROM_EMAIL: support@school-of-rock.edu<br />
API_ACCESS_MANAGER_EMAIL: support@school-of-rock.edu<br />
BUGS_EMAIL: support@school-of-rock.edu<br />
BULK_EMAIL_DEFAULT_FROM_EMAIL: support@school-of-rock.edu<br />
CONTACT_EMAIL: support@school-of-rock.edu<br />
DEFAULT_FEEDBACK_EMAIL: support@school-of-rock.edu<br />
DEFAULT_FROM_EMAIL: support@school-of-rock.edu<br />
PAYMENT_SUPPORT_EMAIL: support@school-of-rock.edu<br />
PRESS_EMAIL: support@school-of-rock.edu<br />
SERVER_EMAIL: support@school-of-rock.edu<br />
TECH_SUPPORT_EMAIL: support@school-of-rock.edu<br />
UNIVERSITY_EMAIL: support@school-of-rock.edu</p>
<p># Platform feature flags<br />
FEATURES:<br />
ENABLE_BULK_ENROLLMENT_VIEW: false<br />
ENABLE_COMBINED_LOGIN_REGISTRATION: true<br />
ENABLE_CORS_HEADERS: true<br />
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: true<br />
ENABLE_DISCUSSION_HOME_PANEL: true<br />
ENABLE_DISCUSSION_SERVICE: true<br />
ENABLE_EDXNOTES: false<br />
ENABLE_GRADE_DOWNLOADS: true<br />
ENABLE_INSTRUCTOR_ANALYTICS: false<br />
ENABLE_LTI_PROVIDER: false<br />
ENABLE_MOBILE_REST_API: false<br />
ENABLE_OAUTH2_PROVIDER: false<br />
ENABLE_SPECIAL_EXAMS: false<br />
ENABLE_SYSADMIN_DASHBOARD: false<br />
ENABLE_THIRD_PARTY_AUTH: true<br />
PREVIEW_LMS_BASE: preview.courses.school-of-rock.edu</p>
<p># To enable comprehensive (custom) theming<br />
ENABLE_COMPREHENSIVE_THEMING: false<br />
COMPREHENSIVE_THEME_DIRS:<br />
– ‘/edx/app/edxapp/edx-platform/themes/’<br />
DEFAULT_SITE_THEME: ‘schoolofrock’</p>
<p># Regionalization<br />
TIME_ZONE: America/New_York<br />
LANGUAGE_CODE: en</p>
<p># AWS services<br />
AWS_ACCESS_KEY_ID: null<br />
AWS_SECRET_ACCESS_KEY: null</p>
<p># to configure an SMTP email provide, such as AWS SES<br />
AWS_SES_REGION_ENDPOINT: email.us-east-1.amazonaws.com<br />
EMAIL_HOST: email-smtp.eu-west-3.amazonaws.com<br />
EMAIL_HOST_PASSWORD: BBajUCiAlvjHus3OtB3b1uR8T3ZDvLpjgu8uKA3P/kQr<br />
EMAIL_HOST_USER: ‘AKIA4MMXYBZIQNSIVGTP’<br />
EMAIL_PORT: 465<br />
EMAIL_USE_TLS: true</p>
<p># AWS S3 storage bucket setup, for anciallary instructor course content<br />
# such as course content supplements like pdf documents and image files<br />
AWS_QUERYSTRING_AUTH: false<br />
AWS_S3_CUSTOM_DOMAIN: SET-ME-PLEASE (ex. bucket-name.s3.amazonaws.com)<br />
AWS_SES_REGION_NAME: us-east-1<br />
AWS_STORAGE_BUCKET_NAME: SET-ME-PLEASE (ex. bucket-name)<br />
FILE_UPLOAD_STORAGE_BUCKET_NAME: SET-ME-PLEASE (ex. bucket-name)</p>
<p># customization of new user registration form<br />
REGISTRATION_EXTRA_FIELDS:<br />
city: hidden<br />
confirm_email: hidden<br />
country: required<br />
gender: optional<br />
goals: optional<br />
honor_code: required<br />
level_of_education: optional<br />
mailing_address: hidden<br />
terms_of_service: hidden<br />
year_of_birth: optional</p>
<p># Google Analytics<br />
GOOGLE_ANALYTICS_ACCOUNT: null<br />
GOOGLE_ANALYTICS_LINKEDIN: ”<br />
GOOGLE_ANALYTICS_TRACKING_ID: ”<br />
GOOGLE_SITE_VERIFICATION_ID: ”</p>
<p># Session managment<br />
# only important if you add SSL/https or<br />
# if you want give the CMS its own site name<br />
SESSION_COOKIE_SECURE: true<br />
SESSION_COOKIE_DOMAIN: ‘school-of-rock.edu’<br />
BASE_COOKIE_DOMAIN: courses.school-of-rock.edu<br />
CORS_ORIGIN_ALLOW_ALL: false<br />
CORS_ORIGIN_WHITELIST: [<br />
‘courses.school-of-rock.edu’,<br />
‘cms.school-of-rock.edu’<br />
] CROSS_DOMAIN_CSRF_COOKIE_DOMAIN: courses.school-of-rock.edu<br />
CROSS_DOMAIN_CSRF_COOKIE_NAME: native-csrf-cookie<br />
LOGIN_REDIRECT_WHITELIST:<br />
– cms.school-of-rock.edu[/code]

Open edX Architecture

Drilling down more holistically, the Open edX platform is a collection of interoperating web sites running on Ubuntu Linux. Most of these sites are built on the Python/Django framework and leverage a variety of front-end technologies, albeit there is a trend towards standardizing on ReactJS. The diagram below illustrates at a high level how these technologies interoperate while also highlighting modules and subsystems of interest.

Front end technologies of interest

Mind you, for normal configuration activities you have absolutely no reason whatsoever to modify any of these files. But in the interest of better understanding the platform, I’m outlining the principal technologies that are part of, or are part of compiling, the Open edX front end.

Back end technologies of interest

Likewise, it is unlikely that you need to modify any of these files. I’m providing this information strictly in the interest of improving your understanding of the Open edX architecture.

Ubuntu subsystems of interest

you absolutely should not modify any of the settings of these subsystems. The dev team at edX has already provided configuration parameters in /edx/etc/lms.yml and /edx/etc/cms.yml for any subsystem setting that might need to modified at any time in the lifecycle of your Open edX project; not matter how large it might scale.

File Layout for a Generic Django Project

Django projects share a common file organization scheme, which is wonderful because this will help you to quickly get acquainted with the multiple Django projects that makeup the Open edX platform. LMS and CMS are bundled into multiple individual Django projects (lms, cms, common, and openedx) all of which you’ll find in /edx/app/edxapp/edx-platform/. Additionally, there are individual projects for Discovery, E-commerce, and Certificates.