2014年12月29日 星期一

edX Ubuntu 12.04 64 bit Installation

This page describes how to install the edX Production Stack on a single Ubuntu 12.04 64-bit server from scratch. For other Production Stack installation instructions, see here.

Hardware requirements

The following server requirements will be fine for supporting hundreds of registered students on a single server.
Note: This will runs mysql, memcache, mongo, and all of the edX services (lms, studio, forums, ora/discern) on a single server. In production configurations we recommend that these services run on different servers and that a load balancer is added for redundancy. Setting up production configurations is beyond the scope of this wiki page.
  • Ubuntu 12.04 amd64 (oraclejdk required)
  • Minimum 2GB of memory, 4GB recommended for production servers (with only 2GB some swap space is required, at least during installation)
  • At least one 2.00GHz CPU or EC2 compute unit
  • Minimum 25GB of free disk, 50GB recommended for production servers
For hosting in Amazon we recommend an m3.medium server, seehttps://aws.amazon.com/ec2/pricing
Community Ubuntu AMIs have 8GB on the root directory, make sure to expand it before installing.

Installation instructions

WARNING:
  • These instructions will potentially destroy the server they are run on, you should only do them on a freshly installed virtual machine. But if you still want to have a try to re-install the Open edX stack on the same server, please see this article for some issues you may face and how to fix them.
  • By default ssh will only allow key based authentication. Please setup key based SSH logins or modify the configuration repo to allow for password based SSH logins before running ansible.
NOTES:
  • If you are running your services behind a proxy, please see here
LET'S START:
  • Launch an Ubuntu 12.04 64-bit server and login to it as a user that has full sudo privileges. If you use EC2, use at least m1.large type with EBS and allocate ~50 GB to the root user.
  • Update your Ubuntu package sources
sudo apt-get update -y
sudo apt-get upgrade -y
sudo reboot
  • One step installation
    Please read the contents of the script before running this to ensure you are aware of everything it will do; it is quite extensive. The script requires that the running user can run commands as root via sudo.
    wget https://raw.githubusercontent.com/edx/configuration/master/util/install/vagrant.sh -O - | bash
    
    If you want to install a named release, such as Aspen, just set the OPENEDX_RELEASEvariable before running the script. For example:
    OPENEDX_RELEASE=aspen.1 wget https://raw.githubusercontent.com/edx/configuration/master/util/install/vagrant.sh -O - | bash
    
  • Manual installation (does what the script does)
    Perform the steps below
    sudo apt-get install -y build-essential software-properties-common python-software-properties curl git-core libxml2-dev libxslt1-dev libfreetype6-dev python-pip python-apt python-dev
    sudo pip install --upgrade pip
    sudo pip install --upgrade virtualenv
    
    On the new server, clone the configuration repo:
    cd /var/tmp
    git clone -b release https://github.com/edx/configuration
    
    To allow password based SSH authentication, edit the common role inside ofconfiguration/playbooks/roles/common/defaults/main.yml and setCOMMON_SSH_PASSWORD_AUTH to "yes"
    Install the ansible requirements
    cd /var/tmp/configuration
    sudo pip install -r requirements.txt
    
    Run the edx_sandbox.yml playbook in the configuration/playbooks directory
    cd /var/tmp/configuration/playbooks && sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost,"
    
Note: If you are running on an older version of the configuration repo, use the variable 'edx_platform_commit' instead.
  • Note: If you get npm Error: failed to fetch from registry: coffee-script, put
registry = "http://registry.npmjs.org/"
to /usr/share/npm/npmrc and retry the installation.
  • If ansible stops at some point, look at log files. See locations of log files in the FAQ page.
After installation connect your web browser to the following ports:
  • LMS - 80
  • Studio - 18010

Overriding default web ports

You may want to override the default ports for Studio and lms-preview if you are setting up subdomains to connect to your sandbox. By default nginx will forward studio.* to the studio gunicorn process.
Example where preview.example.com, example.com and studio.example.com all point to the same server and you want to deploy the master branch of the edx-platform repo.
cd /var/tmp/configuration/playbooks/edx-east

sudo ansible-playbook -c local --limit "localhost:127.0.0.1" ../edx_sandbox.yml \
-i "localhost," -e 'EDXAPP_PREVIEW_LMS_BASE=preview.example.com  EDXAPP_LMS_BASE=example.com  EDXAPP_LMS_PREVIEW_NGINX_PORT=80 EDXAPP_CMS_NGINX_PORT=80 EDXAPP_LMS_NGINX_PORT=80 edx_platform_version=master '
See edX-Managing-the-Production-Stack for how to manage and update the server once it is running

出處:https://github.com/edx/configuration/wiki/edX-Ubuntu-12.04-64-bit-Installation

edx-platform 的中文化



edx-platform 的中文化


台灣比較少人討論此技術,只是做出來讓大家知道Open edx如何中文化,以免要花更多時間在這上面。

1.準備

  • 基本的linux知識
  • 部署成功的edx平台(照下面的方式裝)
  • https://github.com/edx/configuration/wiki/edX-Ubuntu-12.04-64-bit-Installation
  • transifex帳號(OpenEdx翻譯項目是在transifex.com上)
  • 最後提醒,請不要使用root用戶,必要時請使用sudo

2.安裝transifex客戶端

1sudo apt-get install transifex-client

3.在使用者目錄新建transifex配置文件並編輯

1vi ~/.transifexrc
寫入以下內容
3username = user
4password = pass
5token =
其中請將username和password改成您自己的用戶名和密碼,token留空

4.修改.transifexrc文件權限

1chmod o+rw ~/.transifexrc

5.切換到edxapp用戶並加載對應的環境變量

1sudo -u edxapp bash
2source /edx/app/edxapp/edxapp_env
3cd /edx/app/edxapp/edx-platform

6.修改*ms.env.json文件

1vi ../lms.env.json
對於舊版本請按照文本對應格式添加
1"LANGUAGE_CODE": "zh-tw"
新版本請直接修改LANGUAGE_CODE對應值為zh-tw
同理修改cms.env.json

7.執行翻譯

使用以下命令來執行
1tx pull -a #这是抓取所有语言包 tx pull -l zh_TW 这是抓取中文(正體)语言包
2paver i18n_generate

8.更新assets

1paver update_assets lms --settings aws
2paver update_assets cms --settings aws
此處兩條命令為新版本中添加,如果您是較早版本,請使用如下命令代替:
1SERVICE_VARIANT=lms rake lms:gather_assets:aws
2SERVICE_VARIANT=cms rake cms:gather_assets:aws

9.退出edxapp用戶並重啟edxapp

1exit
2sudo /edx/bin/supervisorctl -c /edx/etc/supervisord.conf restart edxapp:
出處:https://idefs.com/recordsedx-platform-internationalization-i18n.html/comment-page-0