Skip to content

edX Ubuntu 12.04 64 bit Installation

Tum Chaturapruek edited this page Apr 22, 2014 · 22 revisions

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 m1.medium server, see https://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 virtual machine.

  • 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.

IMPORTANT NOTE: If using a proxy base network you need to complete the following steps:

  • Add the proxy setting to the /etc/enviroment file
sudo vi /etc/enviroment
  • Add the following lines, remember to change proxy.local.com for your url and PORT for the port used:
http_proxy=http://proxy.local.com:PORT
https_proxy=http://proxy.local.com:PORT
ftp_proxy=http://proxy.local.com:PORT
socks_proxy=http://proxy.local.com:PORT
no_proxy=localhost
  • Save the file.
  • Let's make the Proxy available every time that we use sudo
  • Edit the /ect/sudoers file
sudo vi /etc/sudoers
  • Find entry:
Defaults        env_reset
  • Below add
Defaults        env_keep += "http_proxy https_proxy ftp_proxy socks_proxy no_proxy"
  • Edit the /etc/apt/apt.conf file
sudo vi /etc/apt/apt.conf 
  • Add the following lines, remember to change proxy.local.com for your url and PORT for the port used
Acquire::http::proxy "http://proxy.local.com:PORT";
Acquire::https::proxy "http://proxy.local.com:PORT";
  • Logout

END IMPORTANT NOTE

  • Update your Ubuntu package sources
sudo apt-get update -y
sudo apt-get upgrade -y
reboot
  • One step installation with vagrant

    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.github.com/edx/configuration/master/util/install/vagrant.sh -O - | bash ```

  • Manual installation (without vagrant)

    Perform the steps below

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 -b release https://github.com/edx/configuration ```

  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 = "https://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