sudo chmod 400 my_private_key.pem
ssh -i my_private_key.pem ubuntu@<ip_of_your_server>
# For native installation
export OPENEDX_RELEASE=open-release/maple.master
# For devstack docker installation
export OPENEDX_RELEASE=maple.master
- Request logs and errors from the LMS & CMS. If you're getting a 500 error on a certain request, look here.
sudo tail -f /edx/var/log/lms/edx.log sudo tail -f /edx/var/log/cms/edx.log
- Startup error messages and debug output from the running LMS & CMS Django process. If you're getting a startup error, look here.
sudo tail -f /edx/var/log/supervisor/lms-stderr.log sudo tail -f /edx/var/log/supervisor/cms-stderr.log
- Debug output from the supervisor task manager. If you make changes to the supervisor task definitions, look here.
sudo tail -f /edx/var/log/supervisor/supervisord.log
- Errors from Nginx proxy server that front-ends both the LMS and CMS. Mostly access or configuration-related errors. If you're getting a 4xx or 5xx error, look here
sudo tail -f /edx/var/log/nginx/error.log
- Access logs for all requests to the server. If you want to see apache style logs for every request your server is getting, look here.
sudo tail -f /edx/var/log/nginx/access.log
- Error from LMS workers. If you're getting worker errors, look here.
sudo tail -f /edx/var/log/supervisor/lms_default_1-stderr.log sudo tail -f /edx/var/log/supervisor/lms_high_1-stderr.log sudo tail -f /edx/var/log/supervisor/lms_high_mem_1-stderr.log
- Error from CMS workers. If you're getting worker errors, look here.
sudo tail -f /edx/var/log/supervisor/cms_default_1-stderr.log sudo tail -f /edx/var/log/supervisor/cms_high_1-stderr.log
- Errors from Forum service. If you're getting any errors in Forum, look here.
sudo tail -f /edx/var/log/supervisor/forum-stderr.log
- On devstack docker installation
make <service_name>-logs # For LMS make lms-logs
sudo /edx/bin/supervisorctl stop lms
# For ironwood and earlier releases
sudo -u www-data /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms runserver 8000 --settings production
# For koa and later releases
cd /edx/app/edxapp/edx-platform
source /edx/app/edxapp/edxapp_env
sudo -E -u www-data /edx/app/edxapp/venvs/edxapp/bin/python manage.py lms runserver 8000 --settings production
# Once you are done with the debugging
Ctrl + c
sudo /edx/bin/supervisorctl start lms
- Most configuration parameters for the app.
- Feature flags
- backend server locations
- theme related settings
- Authentication parameters for the app
- API Keys
- Database passwords
- occasional settings that are paired with authentication
# For ironwood and earlier releases
sudo nano /edx/app/edxapp/lms.env.json
sudo nano /edx/app/edxapp/cms.env.json
sudo nano /edx/app/edxapp/lms.auth.json
sudo nano /edx/app/edxapp/cms.auth.json
# For juniper and later releases
sudo nano /edx/etc/lms.yml
sudo nano /edx/etc/studio.yml
make lms-shell
apt-get install nano
- List all manage.py commands
# For Native Installation sudo -H -u edxapp bash source ~/edxapp_env cd ~/edx-platform ./manage.py lms --settings production help # For devstack docker installation make lms/studio-shell ./manage.py lms --settings devstack_docker help
- Delete a course in Open edX
./manage.py cms delete_course course-v1:edX+DemoX+Demo_Course --settings <your_settings>
- Open Django shell (InteractiveConsole)
./manage.py lms shell --settings <your_settings>
- Compile SCSS files
./manage.py lms compile_sass --settings <your_settings>
- Collect static files
# For LMS ./manage.py lms --settings <your_settings> collectstatic --ignore "fixtures" --ignore "karma_*.js" --ignore "spec" --ignore "spec_helpers" --ignore "spec-helpers" --ignore "xmodule_js" --ignore "geoip" --ignore "sass" --noinput > /dev/null # For CMS ./manage.py cms --settings <your_settings> collectstatic --ignore "fixtures" --ignore "karma_*.js" --ignore "spec" --ignore "spec_helpers" --ignore "spec-helpers" --ignore "xmodule_js" --ignore "geoip" --ignore "sass" --noinput > /dev/null
- Copy programs data into the LMS
./manage.py lms cache_programs --settings <your_settings>
- Compile Translation files
./manage.py lms compilejsi18n --settings <your_settings> ./manage.py lms compilemessages --settings <your_settings>
- Reindex courses
# reindexes courses with provided keys ./manage.py cms reindex_course <course_id_1> <course_id_2> ... # reindexes all available courses ./manage.py cms reindex_course --all
Discovery maintains metadata for program and course information. To ingest metadata into discovery from LMS, e-commerce, and the marketing site run the following commands in devstack to enter the discovery shell and refresh the metadata.
make discovery-shell
./manage.py refresh_course_metadata
- Restart Supervisor service
sudo systemctl restart supervisor
- See what services are running
sudo /edx/bin/supervisorctl status
- Restarting services
# LMS sudo /edx/bin/supervisorctl restart lms # Workers sudo /edx/bin/supervisorctl restart edxapp_worker:
- Stop services
# LMS sudo /edx/bin/supervisorctl stop lms # Workers sudo /edx/bin/supervisorctl stop edxapp_worker:
# To update lms and cms assets
paver update_assets --settings <your_settings>
# To update lms assets
paver update_assets lms --settings <your_settings>
# To update cms assets
paver update_assets cms --settings <your_settings>
mysql -h <host> -u <username> -p<password>
mysql -u root
use edxapp
CREATE USER 'edxapp001'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON edxapp.* TO 'edxapp001'@'%';
use edxapp_csmh
CREATE USER 'edxapp_cmsh001'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON edxapp_csmh.* TO 'edxapp_cmsh001'@'%';
CREATE USER 'migrate'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON edxapp.* TO 'migrate'@'%';
GRANT ALL PRIVILEGES ON edxapp_csmh.* TO 'migrate'@'%';
# if necessary
FLUSH PRIVILEGES
mongo --port 27017 -u admin -p password --authenticationDatabase admin
cd ~/edx-platform
make requirements
certbot-auto --renew-by-default
-
Install
sudo apt install screen
-
Start a new screen
screen -S <screen_name>
-
List down available screen sessions
screen -ls
-
Resume screen session
screen -r <screen_name>
-
Detach from screen
Ctrl+a d
-
Create a new window in running screen
Ctrl+a c
-
Switch between screen windows
Ctrl+a [0-9]
-
Name screen window
Ctrl+a :title server-1
-
Kill a detached screen
screen -r <screen_name> Ctrl+a :quit
-
For screen labels to properly work, you need to copy follwing file in home directory of the user from which you are going to create a screen
$ nano screenrc hardstatus on hardstatus alwayslastline hardstatus string "%w%=%m/%d %c"
https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/60227913/Managing+OpenEdX+Tips+and+Tricks
https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/49873839/Debugging+Edxapp