How to install edX on EndeavourOS Latest
In this tutorial, we will be guiding you through the steps on how to install edX on EndeavourOS Latest. edX is an online learning platform that offers free online courses and classes from the world’s best universities and institutions. Before proceeding with the installation process, ensure that you have administrative privileges on your system.
Step 1: Update your system
First, we need to ensure that your system is up-to-date by executing the following command on your terminal:
sudo pacman -Syu
Step 2: Install prerequisites
After updating your system, it's time to install the required dependencies for edX by executing the command:
sudo pacman -S git python-pip npm virtualenv uwsgi gcc g++ clang
Step 3: Clone the edX repository
Next, we will clone the whole edX repository using the following command:
git clone https://github.com/edx/edx-platform.git /edx/app/edxapp/edx-platform
Step 4: Create a virtual environment
After cloning the edX repository, we need to create a virtual environment that will isolate the installation of Python packages. Execute the following commands:
cd /edx/app/edxapp/edx-platform
sudo virtualenv -p /usr/bin/python2.7 .
source ./bin/activate
Step 5: Install the Python dependencies
With the virtual environment activated, we can now proceed with the installation of the Python dependencies using the following command:
pip install -r requirements/edx/base.txt
Step 6: Install the JavaScript dependencies
After installing the Python dependencies, we need to install JavaScript dependencies using npm package manager by executing the command:
npm install -g bower
sudo -H -u edxapp bash -c "cd /edx/app/edxapp/edx-platform && /edx/bin/pip.edxapp install -r requirements/edx/all.txt &&\
/edx/app/edxapp/edx-platform/node_modules/bower/bin/bower install --allow-root"
Step 7: Create a configuration file
Next, you need to create a configuration file called lms.env.json by copying and modifying the lms.env.json.sample file:
sudo cp /edx/app/edxapp/edx-platform/lms.env.json.sample /edx/app/edxapp/edx-platform/lms.env.json
Next, modify lms.env.json by replacing the following placeholder values :
{LMS_BASE}withlocalhost.{ENVIRONMENT}withsandbox.{CMS_BASE}withlms.{yourdomain}.com.
Step 8: Configure the edX application
After creating the configuration file, we need to create another configuration file called lms.auth.json by copying and modifying the lms.auth.json.template file:
sudo cp /edx/app/edxapp/edx-platform/auth/lms.auth.json.template /edx/app/edxapp/edx-platform/auth/lms.auth.json
sudo chown edxapp:edxapp /edx/app/edxapp/edx-platform/auth/lms.auth.json
After that, replace the text of the lms.auth.json file with the following values:
{
"LMS_ROOT_URL": "http://{LMS_BASE}:8000",
"USE_CUSTOM_AUTH_BACKEND": true,
"CUSTOM_BACKEND_CLASS": "common.djangoapps.third_party_auth.auth_backends.EdxOrgOAuth2",
"OAUTH_DISCOVERY_URL": "https://auth.edx.org",
"OAUTH_CLIENT_ID": "your-client-id",
"OAUTH_CLIENT_SECRET": "your-client-secret",
"OAUTH_AUTHORIZE_URL": "https://auth.edx.org/oauth2/v1/authorize",
"OAUTH_ACCESS_TOKEN_URL": "https://auth.edx.org/oauth2/v1/access_token",
"OAUTH_EXTRA_SCOPE": "user",
"OPEN_EDX_SSO_LOGIN_ENABLED": false
}
Replace LMS_BASE, OAUTH_CLIENT_ID, and OAUTH_CLIENT_SECRET with your own configuration.
Step 9: Migrate the database
After creating the application configuration, it's now time to migrate the database by executing the following commands:
sudo -u edxapp /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms makemigrations --settings=aws
sudo -u edxapp /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms migrate --settings=aws
Step 10: Collect the static files
Next, we need to collect the static files using the following command:
sudo -u edxapp /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms collectstatic --noinput --settings=aws
Step 11: Start the server
Finally, we can start the server using the following command:
sudo /edx/bin/supervisorctl -c /edx/etc/supervisord.conf restart edxapp:
Congrats! edX installation on EndeavourOS is now complete. You can now access your edX instance by navigating to http://localhost:8000.
It's essential to note that this tutorial is just the basics to get started with edX on EndeavourOS. It's recommended to check the edX documentation for more information on how to set up and configure a fully functional edX instance.