标签:
<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>
注 诸多原因,不推荐腾讯企业邮箱
<code>"EMAIL_HOST_USER": "*****", "EMAIL_HOST_PASSWORD":"*****", </code>
<code class="shell">sudo /edx/bin/supervisorctl restart edxapp: </code>
注 一般情况使用默认的本地 smtp 服务,绝对会被拦截
<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 参数未修改正确
<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>
注 暂不建议中文名字。
<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 翻译包
<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 配置
<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 删除
如果删除失败,则数据库删除
删除课程代码为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>
备份
<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>
恢复
<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>
标签:
原文地址:http://www.cnblogs.com/zhaojianwei/p/4659905.html