-
Notifications
You must be signed in to change notification settings - Fork 2
Linux Installation
- 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
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.
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.
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%
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
- 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.
- 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',
}
}
fab server # starts the server
fab sockjs # starts the realtime sockjs tornado server