12月 18

Ubuntu 12.04 64位安装edX步骤(译)

Ubuntu 12.04 64位安装edX详细步骤:
原文地址:https://github.com/edx/configuration/wiki/edX-Ubuntu-12.04-64-bit-Installation
转载请注明出处:http://oldcat.iflab.org/
硬件准备:
·mysql, memchache, mongo 和所有有关edX的服务(lms, studio, forums, ora/discern)。
·Ubuntu 12.04 amd64 (需要Oracle JDK)

·至少2GB的内存,服务器推荐4GB(在安装过程中至少需要2GB左右的对换空间)
·至少一个2GHz的CPU或者EC2计算单元。
·至少25GB的硬盘空间,服务器推荐50GB。

确保在安装前Ubuntu根目录下有8GB的空间。

安装指令:

警告:
·指令在运行过程中可能会让你的服务器崩溃,你只能在一个新的虚拟机上执行这些操作。如果你扔要尝试在这些服务器上重装Open edX,翻我之前的文章。里面有相应问题的处理办法。
·默认情况下,只允许SSH公钥认证。请安装基于密钥的SSH登录方式,或者是配置允许使用的SSH登录密码。这些问题的解决方案也在我的博客中。

开始:
登录Ubuntu,更新源

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

 


一步安装:请在执行脚本前阅读他们,确保你知道将要做的所有事情。涉及很广泛,执行这些脚本需要你有执行sudo的权限。
wget https://raw.githubusercontent.com/edx/configuration/master/util/install/vagrant.sh -O – | bash
如果你想安装一个像Aspen的命名了的release,只需要在执行脚本前设置OPENEDX_RELEASE变量。比如:OPENEDX_RELEASE=aspen.1 wget https://raw.githubusercontent.com/edx/configuration/master/util/install/vagrant.sh -O – | bash
手动安装(脚本)
执行以下步骤:

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

在新的服务器上,克隆配置:

cd /var/tmp
git clone -b release https://github.com/edx/configuration

 


#注:如果不成功,请使用本句:git clone -b master https://github.com/edx/configuration

为了使SSH的验证密码顺利工作,编辑在 configuration/playbooks/roles/common/defaults/main.yml 中的内容。
并且进行如下设置:

COMMON_SSH_PASSWORD_AUTH to "yes"

 


#注:切记设置此项,并且,如果没有配置公钥,reboot后将无法登录服务器!

安装ansible requirements:

cd /var/tmp/configuration
sudo pip install -r requirements.txt

 


执行在 configuration/playbooks 目录下的 edx_sandbox.yml:

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

 


(如果你遇到npm Error:没能从注册表读取脚本。执行:

registry = "http://registry.npmjs.org/"

 


到/usr/share/npm/npmrc后,重新尝试安装。)

·如果ansible在某处停止,请仔细阅读log,找到FAQ页相应位置。
注:FAQ链接:https://github.com/edx/edx-platform/wiki/Test-engineering-FAQ

在安装完成后使用你的浏览器访问以下节点:
·LMS – 80
·Studio – 18010

覆盖默认的网络端口:

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 '
12月 17

[实时更新]Git上edX的Wiki错误汇总(译)

Renew On 12/17/2014

原文地址:https://github.com/edx/configuration/wiki/Re-install-Open-edX-in-Ubuntu-12.04

转载请注明出处:http://oldcat.iflab.org/

在Ubuntu12.04上重新安装Open edX

遇到的错误:
1.MySQL 错误:
#————————————————————————————————————-#
#————————————————————————————————————-#
TASK: [edxlocal | create a database for edxapp] *******************************

failed: [localhost] => {“failed”: true, “item”: “”}

msg: unable to connect, check login_user and login_password are correct, or alternatively check ~/.my.cnf contains credentials

————————————————————————————————————-

这段话的意思是你已经安装完毕mysql server,并且与默认的登录权限不一样。
解决问题的方法:创建 /root/.my.cnf 文件,键入以下内容:

————————————————————————————————————-

user=root

password=<your root pass>

[mysql]

user=root

password=<your root pass>

[mysqldump]

user=root

password=<your root pass>

[mysqldiff]

user=root

password=<your root pass>

#————————————————————————————————————-#
#————————————————————————————————————-#

2.如果进程在导入demo course步骤中失败:

————————————————————————————————————-

删除此文件

/var/tmp/configuration/playbooks/edx_sandbox.yml

重新执行此安装脚本:

# sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost," --limit @/root/edx_sandbox.retry

#————————————————————————————————————-#
#————————————————————————————————————-#
#————————————————————————————————————-#
#————————————————————————————————————-#

3.如果在 安装 xqueue’s “install python post-requirements” 步骤中出错:
————————————————————————————————————-
xqueue virtualenv源:

# source /edx/app/xqueue/venvs/xqueue/bin/activate

安装post-requirements:

(xqueue)# pip install -r /edx/app/xqueue/xqueue/requirements.txt

重启xqueue:

# /edx/bin/supervisorctl restart xqueue xqueue_consumer

删除此文件:

/var/tmp/configuration/playbooks/roles/xqueue/tasks/deploy.yml

重新执行此安装脚本:

# sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost," --limit @/root/edx_sandbox.retry

#————————————————————————————————————-#

12月 16

2014/12/16 edX Install Script

#!/bin/sh
##https://github.com/eduStack/edx-manual/edit/master/NormalINATSLL
## Installs the pre-requisites for running edX on a single Ubuntu 12.04
## instance. This script is provided as a convenience and any of these
## steps could be executed manually.
##
## Note that this script requires that you have the ability to run
## commands as root via sudo. Caveat Emptor!
##

##
## Sanity check
##
if [[ ! “$(lsb_release -d | cut -f2)” =~ $’Ubuntu 12.04′ ]]; then
echo “This script is only known to work on Ubuntu 12.04, exiting…”;
exit;
fi

##
## Change ubuntu repo
##
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i ‘s/security.ubuntu.com/mirrors.ustc.edu.cn/g’ /etc/apt/sources.list
sudo sed -i ‘s/cn.archive.ubuntu.com/mirrors.ustc.edu.cn/g’ /etc/apt/sources.list
sudo sed -i ‘s/us.archive.ubuntu.com/mirrors.ustc.edu.cn/g’ /etc/apt/sources.list

##
## Set pypi index-url
##

sudo mkdir /root/.pip
mkdir ~/.pip

cat << EOF > ~/.pip/pip.conf
[global]
index-url = http://pypi.mirrors.ustc.edu.cn/simple
timeout = 60
EOF

sudo cp ~/.pip/pip.conf /root/.pip/

##
## Install system pre-requisites
##
sudo apt-get update
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

##
## Clone the configuration repository and run Ansible
##
cd /var/tmp
git clone -b master https://github.com/edx/configuration
#git clone -b eduStack https://github.com/eduStack/configuration ERROR!
## rm -rf cd /var/tmp configuration
## Install the ansible requirements
##
cd /var/tmp/configuration
sudo pip install -r requirements.txt

##
## Run the eduStack.yml playbook in the configuration/playbooks directory
##
cd /var/tmp/configuration/playbooks/edx-east
sudo ansible-playbook -c local –limit “localhost:127.0.0.1” ../eduStack.yml -i “localhost,” -e ‘EDXAPP_PREVIEW_LMS_BASE=preview.edustack.net EDXAPP_LMS_BASE=www.edustack.net EDXAPP_CMS_BASE=studio.edustack.net EDXAPP_LMS_PREVIEW_NGINX_PORT=80 EDXAPP_CMS_NGINX_PORT=80 EDXAPP_LMS_NGINX_PORT=80 edx_platform_version=eduStack ‘

Ubuntu 12.04 64Bit Installation(Script)

Aside

#Update your Ubuntu package sources
sudo apt-get update -y
sudo apt-get upgrade -y
reboot

#Change hosts and hostname
sudo vi /etc/hosts
sudo vi /etc/hostname

#Manual installation (without vagrant)
sudo apt-get install -y build-essential software-properties-common python-software-properties curl git-core libxml2-dev libxslt1-dev python-pip python-apt python-dev
wget https://bitbucket.org/pypa/setuptools/raw/0.8/ez_setup.py -O – | sudo python
sudo pip install –upgrade pip
sudo pip install –upgrade virtualenv

#On the new server, clone the configuration repo
cd /var/tmp
git clone https://github.com/edx/configuration

#Insatall the ansible requirements
cd /var/tmp/configuration
sudo pip install -r requirements.txt

#Change documents
cd /var/tmp/configuration/playbooks/roles/common/defaults
sudo vi main.yml
#————————————————————–#
COMMON_PYPI_MIRROR_URL: ‘http://pypi.douban.com/simple’
COMMON_SSH_PASSWORD_AUTH: “yes”
#————————————————————–#
cd /var/tmp/configuration/playbooks/roles/edxapp/defaults
sudo vi main.yml
#————————————————————–#
EDXAPP_LMS_BASE: ‘x.momomin.org’
EDXAPP_PREVIEW_LMS_BASE: ‘xpreview.momomin.org’
EDXAPP_CMS_BASE: ‘xstudio.momomin.org’

EDXAPP_SITE_NAME: ‘x.momomin.org’

EDXAPP_LANG: ‘en_US.UTF-8’
EDXAPP_LANGUAGE_CODE : ‘zh-cn’
EDXAPP_TIME_ZONE: ‘Asia/Shanghai’

EDXAPP_TECH_SUPPORT_EMAIL: ‘technical@momomin.org’
EDXAPP_CONTACT_EMAIL: ‘info@momomin.org’
EDXAPP_BUGS_EMAIL: ‘bugs@momomin.org’
EDXAPP_DEFAULT_FROM_EMAIL: ‘registration@momomin.org’
EDXAPP_DEFAULT_FEEDBACK_EMAIL: ‘feedback@momomin.org’
EDXAPP_DEFAULT_SERVER_EMAIL: ‘devops@momomin.org’
EDXAPP_BULK_EMAIL_DEFAULT_FROM_EMAIL: ‘no-reply@momomin.org’
#————————————————————–#
cd /var/tmp/configuration/playbooks/roles/mongo/tasks
sudo vi main.yml
#————————————————————–#
– name: add the mongodb repo to the sources list
apt_repository: > repo=’deb http://mirrors.bistu.edu.cn/mongodb/repo/ubuntu-upstart dist 10gen’
#————————————————————–#
cd /var/tmp/configuration/playbooks/roles/discern/defaults
sudo vi main.yml
#————————————————————–#
discern_nltk_download_url: http://idefs.com/nltk-data-20131113.tar.gz
#————————————————————–#
#Install jdk-7u51-linux-x64.gz and change the name into jdk-7u51-linux-x64.tar.gz
#Upload to /var/tmp
#Install
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=xpreview.momomin.org EDXAPP_LMS_BASE=xstudio.momomin.org EDXAPP_LMS_PREVIEW_NGINX_PORT=80 EDXAPP_CMS_NGINX_PORT=80 EDXAPP_LMS_NGINX_PORT=80 edx_platform_version=master ‘

配置IP和SMTP的路径以及文件名

Aside

IP Address:
/edx/etc/playbooks/edx-east/group_vars/eduStack
/edx/etc/playbooks/edx-east/group_vars/eduStack
/edx/etc/playbooks/group_vars/eduStack

/edx/etc/playbooks/edx-west/group_vars/eduStack
/edx/etc/playbooks/edx-west/group_vars/eduStack

/edx/app/edxapp/cms.env.json
/edx/app/edxapp/lms.env.json

/edx/etc/server-vars.yml:25:EDXAPP_CMS_BASE: studio.edustack.net
/edx/etc/server-vars.yml:27:EDXAPP_CMS_SITE_NAME: studio.edustack.net

/edx/app/certs/env.json
SMTP:
/edx/app/edxapp/cms.env.json
/edx/app/edxapp/lms.env.json