Edx on real machine - WBowam/wbowam.github.com GitHub Wiki

Date: 2014-04-08 Title: 在真机上部署Edx(在中国) Tags: Edx Category: IT

1. Update your Ubuntu package sources

sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot

2.用sshuttle翻墙

(ubuntu下)首先安装它:
sudo apt-get install sshuttle
sshuttle -r [email protected]:22411 0.0.0.0/0 -vv
搞定 , 就这么简单 注意[email protected]:22411是我的ssh,你可以用你自己的,格式为username@sshserver, 我把sshserver理解为跳板机,在我的需求中,需要有一个国外的ssh账号,你有国外的vps的话就好办了,没有也没关系,感谢云平台的的兴起,我们只要注册(nitrous)[https://www.nitrous.io],就能有一个免费的ssh账号.

如果你使用(nitrous)[https://www.nitrous.io]记得每次使用时登录后把它打开.

3.One step installation

wget https://raw.github.com/edx/configuration/master/util/install/vagrant.sh -O - | bash

4.防止出错

上一步中,因为自动化脚本涉及到下载nltk包,由于我们翻墙了,网速可能会较慢,长时间下载(很有可能会出错),我们不想等待,如下操作。当然,如果你执意要等,不用做如下的操作

手动下载nltk

cd /var/tmp
wget http://edx-static.s3.amazonaws.com/nltk/nltk-data-20131113.tar.gz
chmod o+rw nltk-data-20131113.tar.gz

修改/var/tmp/configuration/playbooks/edx-east/roles/ora/tasks/ease.yml 中的download and install nltk任务内容为:

- name: download and install nltk
  shell: |
      set -e
      cp /var/tmp/nltk-data-20131113.tar.gz {{ ora_nltk_tmp_file }}
      tar zxf {{ ora_nltk_tmp_file }}
      rm -f {{ ora_nltk_tmp_file }}
      touch {{ ora_nltk_download_url|basename }}-installed
        creates={{ ora_data_dir }}/{{ ora_nltk_download_url|basename }}-installed
        chdir={{ ora_data_dir }}
  sudo_user: "{{ common_web_user }}"
  notify:
    - restart ora
    - restart ora_celery

修改/var/tmp/configuration/playbooks/edx-east/roles/discern/tasks/deploy.yml 中的download and install nltk任务内容为

- name: download and install nltk
  shell: |
      set -e
      cp /var/tmp/nltk-data-20131113.tar.gz {{ discern_nltk_tmp_file }}
      tar zxf {{ discern_nltk_tmp_file }}
      rm -f {{ discern_nltk_tmp_file }}
      touch {{ discern_nltk_download_url|basename }}-installed
        creates={{ discern_data_dir }}/{{ discern_nltk_download_url|basename }}-installed
        chdir={{ discern_data_dir }}
  sudo_user: "{{ discern_user }}"
  notify:
    - restart discern
手动安装django==1.4.3
sudo /edx/app/venvs/ora/bin/pip install django==1.4.3

/edx/app/ora/ora/requirements.txt里的django==1.4.3注释掉


安装的过程中,可能因为各种原因自动化脚本报错而停止,修复完问题后,可用如下命令从出错的位置开始执行

cd /var/tmp/configuration/playbooks && sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost,"

⚠️ **GitHub.com Fallback** ⚠️