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
Community Ubuntu AMIs have 8GB on the root directory, make sure to expand it before installing.
Installation instructions
WARNING:
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_RELEASE
variable 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:
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 '
出處:https://github.com/edx/configuration/wiki/edX-Ubuntu-12.04-64-bit-Installation