<code>/edx/app/edxapp/lms.env.json #|env文件 裏包含一些功能開關 /edx/app/edxapp/cms.env.json #| /edx/app/edxapp/lms.auth.json #|auth 文件包含一些密碼 權限相關 /edx/app/edxapp/cms.auth.json #| </code>
<code class="shell">sudo -u edxapp bash source /edx/app/edxapp/edxapp_env cd /edx/app/edxapp/ </code>
<code>"EMAIL_HOST": "smtp.iflab.org", "EMAIL_PORT": 25, "EMAIL_USE_TLS": true, </code>
注 諸多緣由,不推薦騰訊企業郵箱python
<code>"EMAIL_HOST_USER": "*****", "EMAIL_HOST_PASSWORD":"*****", </code>
<code class="shell">sudo /edx/bin/supervisorctl restart edxapp: </code>
注 通常狀況使用默認的本地 smtp 服務,絕對會被攔截
mysql
<code class="shell">sudo -u edxapp bash source /edx/app/edxapp/edxapp_env cd /edx/app/edxapp/ </code>
<code>"CMS_BASE": "studio.edustack.net", "PREVIEW_LMS_BASE": "lms.mnu.cn", "LMS_BASE": "mooc.mnu.cn", "SITE_NAME": "mooc.mnu.cn", </code>
注 若是收到郵件爲localhost,則是此處 SITE_NAME 參數未修改正確nginx
<code class="shell">sudo /edx/bin/supervisorctl restart edxapp: </code>
<code class="shell">sudo -u edxapp bash source /edx/app/edxapp/edxapp_env cd /edx/app/edxapp/ </code>
<code>"PLATFORM_NAME": "eduX", </code>
注 暫不建議中文名字。
git
<code class="shell">sudo -u edxapp bash source /edx/app/edxapp/edxapp_env cd /edx/app/edxapp/ </code>
<code>"LANGUAGE_CODE": "zh-cn", </code>
<code>sudo /edx/bin/edxapp-update-assets-lms sudo /edx/bin/edxapp-update-assets-cms </code>
<code class="shell">sudo /edx/bin/supervisorctl restart edxapp: </code>
注 此處只調用官方release 翻譯包
github
<code>sudo -u edxapp bash source /edx/app/edxapp/edxapp_env cd /edx/app/edxapp/ </code>
<code>cd /edx/app/edxapp/themes git clone https://github.com/eduStack/eduStack-theme.git </code>
<code>"USE_CUSTOM_THEME": true "THEME_NAME": "eduStack-theme", </code>
<code>sudo /edx/bin/edxapp-update-assets-lms sudo /edx/bin/edxapp-update-assets-cms </code>
<code class="shell">sudo /edx/bin/supervisorctl restart edxapp: </code>
<code class="shell">sudo -u certs bash cd /edx/app/certs </code>
<code>"CERT_DOWNLOAD_URL": "http://www.edustack.net:18090", "CERT_URL": "http://www.edustack.net:18090", "CERT_VERIFY_URL": "http://www.edustack.net:18090", </code>
注 不要輕易更換端口。如若更換請記得更換 nginx 配置sql
<code class="shell">sudo /edx/bin/supervisorctl restart certs </code>
<code>sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp lms --settings aws </code>
<code>sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp lms --settings aws create_user -e iflab@bistu.edu.cn sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp lms --settings aws changepassword iflab sudo /edx/bin/edxapp-shell-lms aws </code>
<code>from django.contrib.auth.models import User me = User.objects.get(username="iflab") me.is_superuser - True me.is_staff - True me.save() </code>
<code class="shell">sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp cms --settings aws delete_course 組織名/課程代碼/課程學期 commit e.g: sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp cms --settings aws delete_course bistu/M110/2014_T1 commit </code>
注 也可經過具備 staff 權限的帳號登錄 yourdomain/sysadmin 刪除
若是刪除失敗,則數據庫刪除shell
刪除課程代碼爲999的課程:數據庫
<code>mongo use edxapp db.modulestore.find( { "_id.category" : "course" }, {'name':'1'} ) db.modulestore.remove({'_id.course': '999'}) </code>
<code class="shell">sudo /edx/bin/edxapp-update-assets-lms sudo /edx/bin/edxapp-update-assets-cms </code>
<code class="shell">sudo /edx/bin/supervisorctl -c /edx/etc/supervisord.conf status </code>
<code>cd /var/tmp git clone https://github.com/edx/edx-demo-course.git sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp cms --settings aws import /edx/var/edxapp/data /var/tmp/edx-demo-course </code>
備份django
<code>mongodump -d edxapp -o /var/tmp/ mongodump -d cs_comments_service_development -o /var/tmp/ </code>
<code>mysqldump -uroot -p edxapp >/var/tmp/edxapp.sql mysqldump -uroot -p ora >/var/tmp/ora.sql mysqldump -uroot -p xqueue >/var/tmp/xqueue.sql </code>
<code>cd /var/tmp tar cvf cs_comments_service_development.tar cs_comments_service_development/ tar cvf edxapp.tar edxapp/ </code>
恢復json
<code class="shell">cd /var/tmp tar xvf *******.tar </code>
<code>mongorestore -d edxapp --directoryperdb /var/tmp/edxapp mongorestore -d cs_comments_service_development --directoryperdb /var/tmp/cs_comments_service_development </code>
<code>mysql -u root -p use edxapp; source /var/tmp/edxapp.sql; use ora; source /var/tmp/ora.sql; use xqueue; source /var/tmp/xqueue.sql; </code>