NOTE: These are instructions for the Full Stack or Native configuration, not the Developer Stack.
login to the server and change to the /edx/app/edxapp/edx-platform
directory to use manage.py
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/manage.py lms --settings production help
create or upgrade a user to superuser
Execute the following commands (updating the username and email account appropriately)
sudo su edxapp -s /bin/bash cd source /edx/app/edxapp/edxapp_env python /edx/app/edxapp/edx-platform/manage.py lms manage_user staff staff@example.com --staff --superuser --settings=production |
See also Creating an admin user in LMS/CMS, which is written for devstack
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/manage.py lms --settings production
changepassword user
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/manage.py lms --settings production
shell
importing a course from github
Example using the demo course
cd /var/tmp
git clone https://github.com/edx/edx-demo-course.git
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/manage.py cms --settings=production
import /edx/var/edxapp/data /var/tmp/edx-demo-course
run migrations
cd /var/tmp
git clone https://github.com/edx/edx-demo-course.git
source /edx/app/edxapp/edxapp_envpython /edx/app/edxapp/edx-platform/manage.py {lms/cms} syncdb --settings=
production
delete course
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/
manage.py cms --settings=
production
delete_course Organization/CourseNumber/CourseRun
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/
manage.py cms --settings=
production
delete_course course-v1:Organization+CourseNumber+CourseRun commit
See help
and help <cmd>
for more information!
First install jq
, then you should be able to just run this. Note that you lms.auth.json
location may be different:
sudo apt-get install jq
sudo mysql $(jq -r '.DATABASES.default | "-u" + .USER + " -p\"" + .PASSWORD + "\" -h" + .HOST + " -P" + ( .PORT | tostring ) + " " + .NAME' /opt/openedx/lms.auth.json)
sudo /edx/bin/supervisorctl
> stop lms cms edxapp_worker:
source /edx/app/edxapp/edxapp_env
python /edx/app/edxapp/edx-platform/manage.py lms runserver 8000 --settings production
When you connect your browser requests will go to the debug server instead of gunicorn through nginx. You will still need to compile static assets of they change
sudo /edx/bin/supervisorctl status
you should see something like the following:
certs RUNNING pid 19862, uptime 0:00:04
cms RUNNING pid 19884, uptime 0:00:03
lms RUNNING pid 19879, uptime 0:00:03
edxapp_worker:cms_default_4 RUNNING pid 19915, uptime 0:00:03
edxapp_worker:cms_high_1 RUNNING pid 19901, uptime 0:00:03
edxapp_worker:cms_low_3 RUNNING pid 19890, uptime 0:00:03
edxapp_worker:lms_default_3 RUNNING pid 19897, uptime 0:00:03
edxapp_worker:lms_high_4 RUNNING pid 19922, uptime 0:00:03
edxapp_worker:lms_high_mem_2 RUNNING pid 19894, uptime 0:00:03
edxapp_worker:lms_low_1 RUNNING pid 19908, uptime 0:00:03
forum RUNNING pid 19855, uptime 0:00:04
ora RUNNING pid 19875, uptime 0:00:04
ora_celery RUNNING pid 19866, uptime 0:00:04
xqueue RUNNING pid 19853, uptime 0:00:04
xqueue_consumer RUNNING pid 19860, uptime 0:00:04
sudo /edx/bin/supervisorctl restart lms
CMS - sudo /edx/bin/supervisorctl restart cms
sudo /edx/bin/supervisorctl restart edxapp_worker:
(Note: the colon character :
at the end of the line is mandatory!)
Use the /edx/bin/update
to update repo versions on the server.
Allowed repo
names [edx-platform, xqueue, cs_comments_service, xserver, ease, edx-ora, configuration, read-only-certificate-code]
Examples:
sudo /edx/bin/update edx-platform master
- change edx-platform to use the latest on the master branchsudo /edx/bin/update cs_comments_service master
- change the forums service to use the latest on the master branchsudo rm -rf /edx/app/edxapp/edx-platform
- to change the remote you need to remove the existing edx-platform checkout/edx/app/edx_ansible/server-vars.yml
- edx_platform_repo: "https://github.com/<user>/edx-platform.git"
sudo /edx/bin/update edx-platform master
- update edx-platform using the forked repoTo compile javascript and css outside of the update script run the following commands:
sudo -H -u edxapp bash
source /edx/app/edxapp/edxapp_env
cd /edx/app/edxapp/edx-platform
paver update_assets cms --settings=production
paver update_assets lms --settings=production
Suggest issuing the following to debug issues with r.js optimizer issues
python manage.py cms --settings=production
collectstatic --noinput
python manage.py lms --settings=production
collectstatic --noinput
To generate dummy translation strings for i18n and right-to-left testing:
sudo -H -u edxapp bash
source /edx/app/edxapp/edxapp_env
cd /edx/app/edxapp/edx-platform
paver i18n_dummy
Check to see if nginx is running:
sudo service nginx status
sudo service nginx start
NGINX logs are located in /edx/var/log/nginx
NGINX configurations are located in/edx/app/nginx/sites-enabled
Check to see if the lms/cms is running
sudo /edx/bin/supervisorctl status lms cms
If you are still unable to connect to the LMS run the following commands:
sudo service nginx stop
sudo service supervisor stop
sudo service supervisor.devpi stop
sudo pkill -u www-data
sudo service nginx start
sudo service supervisor start
sudo service supervisor.devpi start
sudo /edx/bin/supervisorctl stop discern discern_celery \
forum ora ora_celery xqueue xqueue_consumer xserver edxapp_worker:
sudo tail -f /edx/var/log/{lms,cms,nginx}/*log
While tailing the log files try to connect your browser to the LMS or Studio
/edx/var/log
directory./edx/var/log/supervisor
Take a look at this line in the /edx/bin/update
bash script to see where the server-vars.yml file should be:
if [[ -f /edx/var/edx_ansible/server-vars.yml ]]; then
extra_args="-e@/edx/var/edx_ansible/server-vars.yml"
fi
if [[ -f /edx/app/edx_ansible/server-vars.yml ]]; then
extra_args="-e@/edx/app/edx_ansible/server-vars.yml"
fi