Open edX: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
mNo edit summary
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==


According to the [homepage], {{quotation|The Open edX platform is a free--and open source--course management system (CMS) that was originally developed by edX. The Open edX platform is used all over the world to host Massive Open Online Courses (MOOCs) as well as smaller classes and training modules.}}
In 2019, the [https://open.edx.org/ Open edX homepage] stated that {{quotation|edX is the online learning destination co-founded by Harvard and MIT. Open edX is the learner-centric, massively scalable learning platform behind it. Originally envisioned as a MOOC platform, Open edX has evolved into one of the leading learning platforms catering to Higher Ed, enterprise, and government organizations alike.}}


== Installation ==
In 2017, [https://open.edx.org/ the same homepage] had a more focused vision, {{quotation|The Open edX platform is a free--and open source--course management system (CMS) that was originally developed by edX. The Open edX platform is used all over the world to host Massive Open Online Courses (MOOCs) as well as smaller classes and training modules.}}


There are [https://openedx.atlassian.net/wiki/display/OpenOPS/Open+edX+Installation+Options many different ways to install and run an edX server].
See also:
* [[Open edX installation and configuration]]


As of March 31 2017, we managed to install a Bitnami stack as described below.
== Administering Open EdX ==


=== Installation of a test system under Ubuntu 16 ===
The administration interface is available only through the localhost (server machine)
* http://localhost:81/admin


==== Overview ====
This means that you either have to create a tunnel to run a navigator or else launch a firefox on the server and use X windows to display, e.g. if you got your own Linux machine:
 
  ssh server.machine -XY
If you have free access to a server machine, the easiest method is probably installing the "bitnami" stack ([https://bitnami.com/stack/edx/README.txt README.txt] file. It will install a complete software pack in a separate directory including web servers, database servers, several programming languages, etc. The version we tried included:
  - Open edX eucalyptus.3
  - Apache 2.4.25
  - Elasticsearch 0.90.11
  - Erlang 17.4
  - Java 1.8.0_121
  - Memcached 1.4.35
  - MongoDB 2.6.12
  - Mysql 5.6.35
  - Node.js 6.10.0
  - Python 2.7.13
  - RabbitMQ 3.6.8
  - Rails 4.2.8
  - Ruby 2.1.10
  - RubyGems 1.8.12
 
If your machine already runs web servers, data base servers, etc. it will use other ports. From the README file: {{quotation|The default listening port for Apache is 8080, for Elasticsearch 9300, for Memcached 11211, for MongoDB 27017, for MySQL is 3306, for RabbitMQ 5672, for Open edX XQueue 18040 and 18010 for Open edX CMS. If those ports are already in use by other applications, you will be prompted for alternate ports to use.}} This does of course require that you allow that...
 
Summary of ports that must be openend or can remain local (user installation for a system with an existing LAMP/Java stack, changed apache default from 8080 to 8000)
 
{| class="wikitable sortable"
|+PORTS used by edX standard and custom installations
|-
! Service
!system default ports|| default user install
ports
|| our user install || our root install
(machine already had a LAMP stack)
|requires open firewall
|-
|mysql_port
|3306|| 3307 || 3307 || 3307 ||
|-
|smtp_port
|587|| 587 || 587 || 587
|
|-
|apache_server_port
|80|| 8080 || 8000 || 81
|x
|-
|apache_server_ssl_port
|443|| 8443 || 8443 || 443
|x
|-
|mongodb_port
||| 27017 || 27017 || 27017
|-
|elasticsearch_port
||| 9200 || 9200 || 9200
|-
|elasticsearch_node_port
||| 9300 || 9300 || 9300
|-
|rabbitmq_server_port
||| 5672 || 5672 || 5672
|-
|rabbitmq_management_port
||| 15672 || 15672 || 15672
|-
|Open edX XQueue
||| 18040 || 18040 || 18040
|x
|-
|Open edX CMS
||| 18010 || 18010 || 18010
|x
|}
 
==== Installation summary for a simple user ====
 
[[file:bitnami-console.png|thumb|300px|right|Bitnami console (after a succesful install)]]
 
Firstly, have a look at [https://docs.bitnami.com/installer/apps/edx/ this bitnami doc] which is not really advertized.
 
Here are the steps:
* Get the <code>LOCAL INSTALL</code> OpenEx installer from https://bitnami.com/stack/edx
* Make the file executable:
chmod a+x bitnami-edx-eucalyptus.3-0-linux-x64-installer.run
* Create an empty directory somewhere
mkdir /path_yours/edx
* Run the installer (and wait for a very long time)
./bitnami-edx-eucalyptus.3-0-linux-x64-installer.run
: In the beginning it will ask your for an admin login, mail and password. It also requires SMTP information (anonymous is not allowed, so need an account). Alternatively you can use a gmail address.
: '''Important'''. You won't have to wait for a few minutes, but for a very long time, e.g. about 30 minutes on an older but idle Ubuntu 16 box.
* Launch it once the installer is done. You will get a little console (see picture to the right). This console is fairly useless if you are connected through an terminal. Instead you could run the following:
cd your_installation_directory
./ctlscript.sh status
: This will not mean that you actually can use the server, since you very likely may have a firewall that blocks outside access to your server.
: To test in the terminal if the server is actually working your could just type <code>wget localhost:8000</code> (adapt the port number).
* Adapt the firewall (of course you also can restrict to a local network)
# show open ports
sudo ufw status
<nowiki>#</nowiki> add port 8000 (adapt to yours)
sudo ufw allow 8000/tcp
<nowiki>#</nowiki> Open for the Studio (else you cannot create courses)
sudo ufw allow 18010/tcp
<nowiki>#</nowiki> add port 8000 to a restricted area
sudo ufw allow 8000/tcp from ip_number_here
<nowiki>#</nowiki> Reload the firewall
sudo ufw reload
 
Now if you plan to use this as a little production environment
* Open the firewall (see above)
* you should tell your system to launch this script at boot time. E.g. [http://askubuntu.com/questions/814/how-to-run-scripts-on-start-up read this].
 
'''Bugs''' (April 27 2017)
 
* The installation script will run and install under your login. It can not figure out your group name and some configuration files will be wrong. Fix group names in:
properties.ini
apps/edx/conf/httpd-cms.conf
apps/edx/conf/httpd-lms.conf
apps/xqueue/conf/httpd-xqueue.conf
 
* The start up page will display an empty URL (see above). Somehow, Apache will start despite wrong group names, but then something goes wrong. Fix the group name problem, shut down everything and restart.
 
* See [https://community.bitnami.com/t/studios-having-trouble-saving-your-work/48279/2 this] for a "Studio's having trouble saving your work" problem that was easy to fix with an Apache configuration detail. Also, see older versions of this wiki page.
 
* In Eucalyptos versions prior to March 21 2017, Studio will not allow saving an edited block '''Problem not solved so far'''. The problem is fixed. Else in an older install eidt /opt/bitnami/apps/edx/conf/httpd-vhosts.conf:
Replace
<source lang="XML">
<VirtualHost *:18010>
    Include "/opt/bitnami/apps/edx/conf/httpd-cms.conf"
</VirtualHost>
by:
 
<VirtualHost *:18010>
    AllowEncodedSlashes On
    Include "/opt/bitnami/apps/edx/conf/httpd-cms.conf"
</VirtualHost>
</source>
 
=== installation under root ===
 
Since saving a studio edit did not work, I tried reinstalling the whole thing under root. The problem was fixed in a new release, but I keep the root install anyhow. It does seem to be more reliable (processes will run under daemon by default).
 
sudo su
ufw allow 81/tcp
ufw allow 443/tcp
ufw reload
./bitnami-edx-eucalyptus.3-0-linux-x64-installer.run
 
  // kill temp file from user installation
  rm -r /tmp/mako_lms
Below is a slightly censored transcript of the installation dialog. I basically used default values.
 
<source lang="bash">
./bitnami-edx-eucalyptus.3-0-linux-x64-installer.run
X11 connection rejected because of wrong authentication.
----------------------------------------------------------------------------
Welcome to the Open edX powered by Bitnami Setup Wizard.
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
 
Open edX : Y (Cannot be edited)
Demo course for Open edX [Y/n] :Y
Is the selection above correct? [Y/n]: y
----------------------------------------------------------------------------
Installation folder
Please, choose a folder to install Open edX powered by Bitnami
Select a folder [/opt/edx-eucalyptus.3-0]:     
----------------------------------------------------------------------------
Create Admin account
Open edX powered by Bitnami admin user creation
Your real name [User Name]: Daniel K. Schneider
Email Address [user@example.com]:
Login [user]: admin
Password :
Please confirm your password :
----------------------------------------------------------------------------
Web Server Port
Choose a port that is not currently in use, such as port 81.
Apache Web Server Port [81]:   
----------------------------------------------------------------------------
MySQL Information
Please enter your MySQL database information:
Choose a port that is not currently in use, such as port 3307.
MySQL Server port [3307]:
----------------------------------------------------------------------------
The hostname that will be used to create internal URLs. If this value is
incorrect, you may be unable to access your Open edX installation from other
computers.
Hostname [127.0.1.1]: XXXX.unige.ch
Do you want to configure mail support? [y/N]: y
----------------------------------------------------------------------------
Configure SMTP Settings
This is required so your application can send notifications via email.
Default email provider:
[1] GMail
[2] Custom
Please choose an option [1] : 2
----------------------------------------------------------------------------
Configure SMTP Settings
 
This data is stored in the application configuration files and may be visible to
others. For this reason, it is recommended that you do not use your personal
account credentials.
Username []: XXXX-tecfa
Password :
Re-enter :
SMTP Host []: XXXX.unige.ch
SMTP Port [587]:
Secure connection
[1] None
[2] SSL
[3] TLS
Please choose an option [3] : 1
----------------------------------------------------------------------------
Setup is now ready to begin installing Open edX powered by Bitnami on your
computer.
Do you want to continue? [Y/n]: y
----------------------------------------------------------------------------
Please wait while Setup installs Open edX powered by Bitnami on your computer.
Installing
0% ______________ 50% ______________ 100%
########################################
</source>
 
==== To start/stop the server ====
 
You can use the included ctlscript.sh utility that sits in the top-level directory, e.g. /opt/edx-eucalyptus.3-0
sudo ./ctlscript.sh start|stop|restart
 
EdX will be available on the selected port, e.g.
http://yourserver_ip_or_name:81
- or -
http://yourserver_ip_or_name:8080
 
Again, if this does not work from your client machine, adapt the firewall settings (see above)
 
[[file:edx-admin-panel.png|200px|right|thumb|edX administration panel]]
 
==== Initial Configuration - get the admin console working ====
 
By default, anyone now can require an account and will get it. This may attract spammers.
 
After login into the system you cannot do anything, except signing up for the demo class and configuring the admin profile. You can configure edX through the http://youredx:port/admin URL.
 
* Read [http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/ 4. Configuring the Open edX Platform] & enjoy.
 
There are three ways to use the admin console:
 
'''(1) Log into the admin console:'''
  http://localhost/admin
: It only will be available on the localhost, which is really bad news if you cannot run an Xserver on your client machine. If you do happen to have a client linux machine (I do) then you can run firefox on the server machine. Connect to the server with the <code>-XY</code> option !!
ssh your_server -XY
sudo apt-get install firefox
 
Now your freaky Ubuntu will not run the firefox you just installed, but a copy of the one you already may have running on your local machine. Type:
  firefox --new-instance
  firefox --new-instance
Open http://localhost:8000/admin and enjoy the difficult editing over a remote X connection.


It can be configured to be available here (same port as edx-studio)
* http://yoursite:18010/admin/


'''(2) Using a terminal web client'''
Read more in:
* [[Open edX installation and configuration]]


Instead of running a web browser over an X connection, you also can use a terminal browser, E.g.
== Creating a course ==
sudo apt-get install lynx
lynx http://localhost:81/admin


You will see many configuration items grouped into categories. Each item can be edited in three ways:
By default, any registered user can create a course. We find that really strange given all these annoying security features that otherwise imposed. However, in a production system, the administrator may have disabled course creating for non staff members (see [[Open edX installation and configuration]]
* Clicking on the item
* Add
* Change (same as clicking on item)


'''(3) Create an ssh tunnel'''
For creating courses one is supposed to use studio, but someone will have to tell you where to find it. I will, but you also can read [http://docs.edx.org/ the official documentation]


* Read the FAQ section [https://docs.bitnami.com/google/faq/#how-to-access-a-server-using-an-ssh-tunnel How to access a server using an SSH tunnel?]
If you configured your firewall as suggested above, then it is here:
* <code>http://yoursite:edx_port/edx-studio</code> (this will then redirect)


You may have to give the full server name. Example:
* http://yoursite:18010/ (the EdX-Studio website)
* Source port: 81
: Yes it runs by default on port 18010 !
* Destination: your_full_server_name:81


==== Alternatives ====
Creating a course is very simple:
* Hit the big green button and fill in the form
* Add instructors as needed (you need to know their email address and they must have signed up with edX with that email).


The same company also provides solutions for Virtual Machines compatible with Oracle VirtualBox and VMware vSphere, Workstation, and Fusion
[[File:Edx-studio-1.png|600px|thumb|none|edX studio - Creating a course]]


=== Security ===
== Authoring a course ==
'''under construction'''


'''Install AppArmor CodeJail'''
[[File:Edx-studio-3.png|600px|thumb|none|edX studio - Organizing the course]]


(1) Read [https://docs.bitnami.com/installer/apps/edx/#how-to-install-codejail How to install CodeJail Sandbox?] (Bitnami). For a root install, the instructions in the Bitname page (just above) seem to be correct, but some appear to be already done.
[[File:Edx-studio-2.png|600px|thumb|none|edX studio - Adding content to a unit]]
 
(2) Already there (?):
sudo apt-get install apparmor
sudo addgroup sandbox
sudo adduser --disabled-login sandbox --ingroup sandbox
 
(3) After checking the above, continue and create a /etc/sudoers.d/01-sandbox file with the following contents. '''Make bloody damn sure that the path are ok, before you save the file'''. A single mistake in a single line will block your system. If that happens type <code>su</code>, enter the root password (not yours), then edit and uncomment all lines with #. Then restart with sudo.
sudo visudo -f /etc/sudoers.d/01-sandbox
 
File contents:
daemon ALL=(sandbox) SETENV:NOPASSWD:/opt/edx-eucalyptus.3-0/apps/edx/venvs/edxapp-sandbox/bin/python
daemon ALL=(sandbox) SETENV:NOPASSWD:/usr/bin/find
daemon ALL=(ALL) NOPASSWD:/usr/bin/pkill
 
(4) Create/Edit /etc/apparmor.d/opt.bitnami.apps.edx.venvs.edxapp-sandbox.bin.python with the following contents:
 
<source lang="python">
#include <tunables/global>
 
installdir/apps/edx/venvs/edxapp-sandbox/bin/python {
    #include <abstractions/base>
    #include <abstractions/python>
 
    installdir/apps/edx/venvs/edxapp-sandbox/** mr,
    # If you have code that the sandbox must be able to access, add lines
    # pointing to those directories:
    installdir/apps/edx/edx-platform/common/lib/sandbox-packages/** r,
    installdir/python/lib/python2.7/** r,
 
    /tmp/codejail-*/ rix,
    /tmp/codejail-*/** wrix,
</source>
 
(5) Add this to apparmor_parser
 
sudo apparmor_parser /etc/apparmor.d/opt.bitnami.apps.edx.venvs.edxapp-sandbox.bin.python
sudo sudo installdir/ctlscript.sh restart apache
 
== Configuration ==
 
Configuring edX can be fairly confusing to a novice. So far I identified three different interfaces
 
(1) EdX can be configured from the administration console which by default only runs on the server machine (localhost). E.g. if the edX server runs on port 81 (yours may run under 8080), then:
http://localhost:81/admin
 
(2) You also can edit configuration files that sit in the ./apps/edx/conf directory (see below for an example)
 
(3) You can enter command line instructions that sit in the /opt/edx-eucalyptus.3-0/apps/edx/edx-platform directory, e.g.
 
cd /opt/edx-eucalyptus.3-0/apps/edx/edx-platform
 
However, you must launch the scripts with the python stack distributed. To do so, instead of just typing something like ''python manage.py'', you will have to type <code> /opt/edx-eucalyptus.3-0/apps/edx/bin/python.edxapp manage.py</code>
 
List available commands:
sudo /opt/edx-eucalyptus.3-0/apps/edx/bin/python.edxapp ./manage.py lms --settings aws help
 
Once you understood that principle, it still will be difficult to get anything done.
 
=== Creating a user ===
 
The web interface for administrators (http://localhost:81/admin) allows to add users. However, so far, I didn't manage to log in. Maybe the system wants a confirmation email (change bulk email flag ?)
 
Under site administration:
* Authentication and Authorization -> Users
 
The admin interface also allows to change various permissions (seems to work).
 
The following command line script creates a new superuser (verify !!!)
sudo /opt/edx-eucalyptus.3-0/apps/edx/bin/python.edxapp ./manage.edxapp lms manage_user staff staff@example.com --staff --superuser --settings=aws
 
=== Restrict emails to domains ===
 
cd ./apps/edx/conf/
# backup
sudo cp lms.env.json lms.env.json.OLD
sudo cp cms.env.json cms.env.json.ODL
 
In each of the files you could a line at the end that restricts registration to certain domains. Read [http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/config_allowed_regis_emails.html this].
 
Example restring registration to University of Geneva
REGISTRATION_EMAIL_PATTENRS_ALLOWED" : ["^.*@(.*\\.)?unige\\.ch$"]
 
=== LTI ===
 
edX is both an LTI provider and consumer (read [https://open.edx.org/blog/open-edx-lti-tool-provider Open edX as an LTI Tool Provider].
 
(1) Edit edx/app/edxapp/lms.env.json
<source lang="JSON">
"FEATURES" : {
    ...
    "ENABLE_LTI_PROVIDER": true
}
</source>
 
(2) Run database migrations as root
cd /opt/edx-eucalyptus.3-0/apps/edx/edx-platform
../bin/python.edxapp ./manage.py lms syncdb --settings aws
You should see at the end something like:
Running migrations:
  Rendering model states... DONE
  Applying lti_provider.0001_initial... OK
  Applying lti_provider.0002_auto_20160325_0407... O
 
(3) Restart the LMS server
/opt/edx-eucalyptus.3-0/ctlscript.sh
 
A connector with Moodle [https://moodle.org/mod/forum/discuss.php?d=348943 does not seem to be working yet] (March 2017).
 
To add an LTI consumer, e.g. Moodle:
* In the LTI Provider section, next to LTI Consumers select Add.
* Add a consumer name, e.g. My_Moodle
* Keep the automatically generated keys.
* Save
 
To allow students from your Moodle to log into edX:
* Third_Party_Auth section -> Provider Configuration (LTI), select Add (or click on Provider configuration, then add ...)
* Then what ? Moodle does not seem to provide LTI consuming at the systems level...
 
=== Course Talk ===
 
Course talk is the name of an online service for rating courses.
 
You can configure a widget that allow users to rater your courses. Read [http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/add_coursetalk_widget.html 4.6. Adding the CourseTalk Widget]
 
* In the navigation pane of the admin interface, locate Coursetalk, and then select Course talk widget configurations.
 
== Creating a course ==
 
For creating courses one is supposed to use studio, but someone will have to tell you where to find it. I will, but you also can read [read http://docs.edx.org/ the official documentation]  
 
If you configured your firewall as suggested above, then it is here:
 
* http://yoursite:18010/
: Yes it runs by default on port 18010 !
* <code>http://yoursite:edx_port/edx-studio</code> also works and will redirect to the above.


== Links ==
== Links ==
Line 438: Line 52:


The documentation is spread over several places.
The documentation is spread over several places.
* http://docs.edx.org/


* [https://open.edx.org/getting-help Getting help]. Provides a list of online resources.  
* [https://open.edx.org/getting-help Getting help]. Provides a list of online resources.  


* [http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/index.html Installing, Configuring, and Running the Open edX Platform]. As we described above, for testing purposes, it is much easier to start with the Bitnami stack. However, this document still includes important documentation on configuration that one should read.
* [http://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/index.html Installing, Configuring, and Running the Open edX Platform]. As we described in [[Open edX installation and configuration]], for testing purposes, it is much easier to start with the Bitnami stack. However, this document still includes important documentation on configuration that one should read.


* [http://docs.edx.org/ Documentation for edx.org and the Open edX Community]
* [http://docs.edx.org/ Documentation for edx.org and the Open edX Community]
Line 450: Line 66:


* [https://openedx.slackarchive.io/general/ Slack archive] (even if you do not believe that knowledge should be conversational ...)
* [https://openedx.slackarchive.io/general/ Slack archive] (even if you do not believe that knowledge should be conversational ...)
[[category: open education]]

Latest revision as of 16:33, 25 May 2019

Introduction

In 2019, the Open edX homepage stated that “edX is the online learning destination co-founded by Harvard and MIT. Open edX is the learner-centric, massively scalable learning platform behind it. Originally envisioned as a MOOC platform, Open edX has evolved into one of the leading learning platforms catering to Higher Ed, enterprise, and government organizations alike.”

In 2017, the same homepage had a more focused vision, “The Open edX platform is a free--and open source--course management system (CMS) that was originally developed by edX. The Open edX platform is used all over the world to host Massive Open Online Courses (MOOCs) as well as smaller classes and training modules.”

See also:

Administering Open EdX

The administration interface is available only through the localhost (server machine)

This means that you either have to create a tunnel to run a navigator or else launch a firefox on the server and use X windows to display, e.g. if you got your own Linux machine:

ssh server.machine -XY
firefox --new-instance

It can be configured to be available here (same port as edx-studio)

Read more in:

Creating a course

By default, any registered user can create a course. We find that really strange given all these annoying security features that otherwise imposed. However, in a production system, the administrator may have disabled course creating for non staff members (see Open edX installation and configuration

For creating courses one is supposed to use studio, but someone will have to tell you where to find it. I will, but you also can read the official documentation

If you configured your firewall as suggested above, then it is here:

Yes it runs by default on port 18010 !

Creating a course is very simple:

  • Hit the big green button and fill in the form
  • Add instructors as needed (you need to know their email address and they must have signed up with edX with that email).
edX studio - Creating a course

Authoring a course

edX studio - Organizing the course
edX studio - Adding content to a unit

Links

Official documentation

The documentation is spread over several places.

  • Slack archive (even if you do not believe that knowledge should be conversational ...)