Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Linux Installation

A Lee edited this page May 4, 2016 · 2 revisions

RHEL 7 Setup

  • systemd has replaced chkconfig and old style init.d sysvinit - service <foo> start|restart|stop still works but calls off to systemctl
  • mysql renamed to mariadb
  • first init mysql & postgres data directories, then import from dumps
  • set up sentry and vcweb-sockjs server via supervisord, added dedicated ini files to /etc/supervisord.d
  • set up haproxy for SSL termination and nginx + uwsgi

Ubuntu Setup

Python is usually installed by default on most systems but you'll need Python 2.7 along with the development headers to install the postgresql drivers.

Create a virtualenv

A virtualenv is a sandbox for your python installation so any custom python modules or frameworks we download and install won't muck with the system Python install. virtualenvwrapper is recommended.

Checkpoint

You should have Python 2.7, fabric, and virtualenv installed and setup correctly.
Try running:

python -V
fab test

You should also be in your vcweb virtualenv, your shell prompt should look something like (vcweb) username%

Setting up the development environment

Dependencies:

  • lxml
  • postgresql dev headers for the psycopg2 python postgres drivers
  • redis
sudo apt-get install postgresql postgresql-server-dev-9.3 sqlite3 libmemcached-dev python-lxml libxslt1-dev

Once these dependencies are installed you should be able to cd into the repo and install all the required python frameworks by executing the following:

pip install -Ur vcweb/requirements.pip
hash -r

Setting up the database

  1. Create a postgres database and user with the appropriate permissions. See the postgres pb_hba docs for more details.
% sudo vim ${POSTGRES_DATA_DIRECTORY}/pg_hba.conf
% sudo systemctl restart postgresql # reload the changes in your pg_hba.conf

Create the postgres user and database

% sudo su postgres -
% createuser vcweb -edPSR # if you want to use a password / md5 authentication, otherwise replace -P with -w
Enter password for new role:
Enter it again:
% createdb vcweb -O vcweb 

If you set a password for your postgres vcweb user, make sure it's set in settings/local.py as well.

  1. Copy settings/local.py.example or settings/dev.py to settings/local.py and edit as needed
DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'vcweb',
            'USER': 'vcweb',
            'PASSWORD': 'changeme',
            }
        }

Starting the app

fab server # starts the server
fab sockjs # starts the realtime sockjs tornado server