Open edX已经出来几个稳定版,最近访问官方的wiki:https://openedx.atlassian.net/wiki/display/OpenOPS/Native+Open+edX+Ubuntu+12.04+64+bit+Installation#space-menu-link-content,看到dogwood.3已经出来了,最终Open edX暂时还是基于Ubuntu 12.04 x64系统安装,一直没有升级到Ubuntu14.04 x64,其实官方在出dogwood beta版时候曾经加入支持Ubuntu14.04 x64,但是不知什么原因,很短时间又把支持Ubuntu14.04 x64的代码撤掉了,可能是稳定性的问题吧。鉴于目前很多新的服务器已经不支持Ubuntu 12.04 x64了,Open edX如果安装到Ubuntu14.04 x64需要做一点配置上修改,整个安装过程只能一步一步的安装。
整个安装过程还是参考官方的安装教程https://openedx.atlassian.net/wiki/display/OpenOPS/Native+Open+edX+Ubuntu+12.04+64+bit+Installation#space-menu-link-content,硬件要求参照官方信息。只是这里把系统改成Ubuntu14.04 x64,建议安装系统选择英文安装,组件只安装ssh,毕竟是服务器系统,稳定及内耗最低是很重要的,能省就省。
接下按照官方的步骤开始安装Open edX,要想顺利安装,最好找一个稳定的vpn,有些源被河蟹了,不然安装过程会碰到各种问题。
- 更新您的服务器的系统软件
sudo apt-get update sudo apt-get upgrade -y sudo reboot
- 安装dogwood.3版本,首先导入版本号,edX稳定版版本号地址:https://openedx.atlassian.net/wiki/display/DOC/Open+edX+Releases,您可以挑选自己喜欢的版本来安装
export OPENEDX_RELEASE=named-release/dogwood.3
- 接下来把代码
中的https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/sandbox.sh 改为https://raw.githubusercontent.com/edx/configuration/named-release/dogwood.3/util/install/sandbox.sh 该地址直接在浏览器打开如下:wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/sandbox.sh -O - | bash
#!/bin/sh ## ## 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 ## ## Set ppa repository source for gcc/g++ 4.8 in order to install insights properly ## sudo apt-get install -y python-software-properties sudo add-apt-repository ppa:ubuntu-toolchain-r/test ## ## Update and Upgrade apt packages ## sudo apt-get update -y sudo apt-get upgrade -y ## ## Install system pre-requisites ## 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 libxmlsec1-dev libfreetype6-dev swig gcc-4.8 g++-4.8 sudo pip install --upgrade pip==7.1.2 sudo pip install --upgrade setuptools==18.3.2 sudo -H pip install --upgrade virtualenv==13.1.2 ## ## Update alternatives so that gcc/g++ 4.8 is the default compiler ## sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 ## Did we specify an openedx release? if [ -n "$OPENEDX_RELEASE" ]; then EXTRA_VARS="-e edx_platform_version=$OPENEDX_RELEASE \ -e certs_version=$OPENEDX_RELEASE \ -e forum_version=$OPENEDX_RELEASE \ -e xqueue_version=$OPENEDX_RELEASE \ -e configuration_version=$OPENEDX_RELEASE \ -e NOTIFIER_VERSION=$OPENEDX_RELEASE \ -e INSIGHTS_VERSION=$OPENEDX_RELEASE \ -e ANALYTICS_API_VERSION=$OPENEDX_RELEASE \ " CONFIG_VER=$OPENEDX_RELEASE else CONFIG_VER="master" fi ## ## Clone the configuration repository and run Ansible ## cd /var/tmp git clone https://github.com/edx/configuration cd configuration git checkout $CONFIG_VER ## ## Install the ansible requirements ## cd /var/tmp/configuration sudo -H 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," $EXTRA_VARS
<span style="font-family: Arial, Helvetica, sans-serif;">上面的代码只要手动运行没有注释的部分,代码</span>
用来判断操作系统是否是Ubuntu 12.04,这里我们改为Ubuntu 14.04 x64,这步跳过。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
- 设置gcc/gcc+ 4.8的安装源
sudo apt-get install -y python-software-properties sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- 更新安装源
sudo apt-get update sudo apt-get upgrade -y
- 安装系统必须软件包
在这里添加一个必须组件libmysqlclient-dev,不然会报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j5lOCo/MySQL-pythonsudo 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 libxmlsec1-dev libfreetype6-dev swig gcc-4.8 g++-4.8 libmysqlclient-dev sudo pip install --upgrade pip==7.1.2 sudo pip install --upgrade setuptools==18.3.2 sudo -H pip install --upgrade virtualenv==13.1.2
- 设置gcc/gcc+ 4.8为默认系统调用
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
- 因为我们是指定的版本安装,需要设置系统变量
if [ -n "$OPENEDX_RELEASE" ]; then EXTRA_VARS="-e edx_platform_version=$OPENEDX_RELEASE \ -e certs_version=$OPENEDX_RELEASE \ -e forum_version=$OPENEDX_RELEASE \ -e xqueue_version=$OPENEDX_RELEASE \ -e configuration_version=$OPENEDX_RELEASE \ -e NOTIFIER_VERSION=$OPENEDX_RELEASE \ -e INSIGHTS_VERSION=$OPENEDX_RELEASE \ -e ANALYTICS_API_VERSION=$OPENEDX_RELEASE \ " CONFIG_VER=$OPENEDX_RELEASE else CONFIG_VER="master" fi
- 接下来下载edX的安装配置文件
cd /var/tmp git clone https://github.com/edx/configuration cd configuration git checkout $CONFIG_VER
- edX配置文件git完成后,需要手动修改,首先修改配置让支持Ubuntu 14.04 x64
按i进入编辑状态vi /var/tmp/configuration/playbooks/roles/edxapp/tasks/python_sandbox_env.yml
修改command: update-alternatives –set libblas.so.3gf /usr/lib/libblas/libblas.so.3gf
to:
command: update-alternatives –set libblas.so.3 /usr/lib/libblas/libblas.so.3
及command: update-alternatives –set liblapack.so.3gf /usr/lib/lapack/liblapack.so.3gf
to:
command: update-alternatives –set liblapack.so.3 /usr/lib/lapack/liblapack.so.3 然后按“ESC”键退出编辑模式,输入“:wq” 保存并退出。 - 要想安装完成默认语言为简体中文,需要修改代码
vi /var/tmp/configuration/playbooks/roles/edxapp/defaults/main.yml 同上进入编辑模式找到 EDXAPP_PLATFORM_NAME: '平台名字' EDXAPP_STUDIO_NAME: '课程管理端名字' EDXAPP_STUDIO_SHORT_NAME: '简称' EDXAPP_LANGUAGE_CODE : 'zh-hans' EDXAPP_TIME_ZONE: 'Asia/Shanghai' 然后保存并退出
- 接下来安装ansible必须软件
cd /var/tmp/configuration sudo -H pip install -r requirements.txt
- 最后一步安装edX代码
最后一步比较漫长,如果网络很稳定,应该2个小时左右显示完成,完成结果所有都成功,失败数为0cd /var/tmp/configuration/playbooks && sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost," $EXTRA_VARS
- 最后注意:如果中断安装,重启服务器了,需要先运行步骤2 然后步骤9,最后继续运行步骤14,中间有失败,重复运行步骤14。
全部完成后访问截图如下 学生端直接访问ip,教师端ip:18010 管理端http://ip/admin 平台配置修改配置会在下一篇写。