之前记录的EDX克隆到虚拟机,从克隆到Xblock的部署
创建文件夹:
mkdir xblock
切换权限:(edx/app/edxapp/)
sudo chown edxapp.edxapp xblock
切换用户:(edx/app/edxapp/xblock)
sudo -H -u edxapp bash
创建虚拟环境:
virtualenv venv
source venv/bin/activate(环境激活)
deactivate(关闭虚拟环境)
(venv) edxapp@eduStack:~/xblock$ wget https://github.com/edx/xblock-sdk/archive/master.zip
(venv) edxapp@eduStack:~/xblock$ unzip master.zip
(venv) edxapp@eduStack:~/xblock/xblock-sdk/requirements$ pip install -r base.txt
创建一个xblock:
(venv) edxapp@eduStack:~/xblock$ python xblock-sdk/bin/workbench-make-xblock
> Short name: cqu
> Class name: CquXBlock
deactivate(退出虚拟环境)
source /edx/app/edxapp/venvs/bin/ activate
(edxapp) edxapp@eduStack:~$ pip install -e xblock/cqu
sudo vim /edx/app/edxapp/cms.env.json (定位FEATURES添加:) "ALLOW_ALL_ADVANCED_COMPONENTS": true,
修改配置后重启cms:
source /edx/bin/supervisorctl restart cms
配置FTP
sudo apt-get update
sudo apt-get intsall vsftpd
sudo service vsftpd start
(默认账号密码:edustack edustack.org)
提升用户权限root:
修改密码:sudo passwd (输入两次新密码)
进入root用户:su (输入新密码)
cd /etc/ssh/
vim sshd_config (修改:PermitRootLogin prohibit-password : 改为yes)
重启sshd服务:service sshd restart
SSH链接:
CMD下:
ssh root@192.168.174.111 (输入密码即可)
pycharm:
新建项目 edxapp
连接 VSTP
配置deployment 路径:/
压缩文件:
tar -cf edx-platform.tar edx-platform/*
zip edx-platform.tar.zip edx-platform.tar
将解压的edx-platform剪切到edxapp下
可同步瞅瞅
新建xblock目录到edxapp
下载:https://github.com/longmen21/VideoJSXBlock-Pro,解压到xblock
root@eduStack:/edx/app/edxapp/xblock# chown -R edxapp.edxapp VideoJSXBlock-Pro/
root@eduStack:/edx/app/edxapp/xblock# sudo -H -u edxapp bash
edxapp@eduStack:~$ source venvs/edxapp/bin/activate
(edxapp) edxapp@eduStack:~$ pip install -e xblock/VideoJSXBlock-Pro/
(edxapp) edxapp@eduStack:~$ pip install django-debug-toolbar
(edxapp) edxapp@eduStack:~$ pip install django-debug-toolbar-mongo
sudo -u www-data /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py cms runserver 0.0.0.0:8089
修改videojs.py 中 load_resource() 函数 return resource_content.decode("utf-8")
登陆192.168.174.111:8089 账号:staff@example.com 密码:edx
设置->高级设置->添加videojs
edustack@eduStack:~$ /edx/bin/supervisorctl stop all #停止服务
edustack@eduStack:~$ sudo -u www-data /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py cms runserver 0.0.0.0:8089
版权声明:《 EDX平台从克隆到Xblock部署 》为DYBOY原创文章,转载请注明出处!
最后编辑:2019-1-29 16:01:31