Skip to content

Installation Debian Wheezy 7.0.0

jawr edited this page May 15, 2013 · 4 revisions

Install some global dependencies:

apt-get update && apt-get install git vim rabbitmq-server

Install PostrgreSQL (Or another backend DB)

Install postgres:

apt-get install postgresql postgresql-client postgresql-contrib postgresql-doc postgres postgresql-server-dev-9.1

Set the password for the postgres user:

passwd postgres
su - postgres

Create the kontrolvm user for the application to use:

createuser kontrolvm
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create new roles? (y/n) n

Set the password for our user:

psql -d template1 -c "alter user kontrolvm with password '*A*PASSWORD*'"

Create our database:

createdb kontrolvm

Install our virtualenv and install KontrolVM

Install PIP and virtualenv:

apt-get install python-pip python-dev python-libvirt
easy_install virtualenv

Create our virtualenv:

cd /srv
virtualenv kontrolvm
cd kontrolvm; source bin/activate

Pull over the libvirt python bindings:

cp /usr/lib/python2.7/dist-packages/*libvirt* /srv/kontrolvm/lib/python2.7/site-packages/

Install KontrolVM:

git clone https://github.com/jawr/kontrolvm.git
pip install -r kontrolvm/requirements.txt

Setup local_settings.py:

cd kontrolvm
vim kontrolvm/local_settings.py

Using this template:

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = ''
EMAIL_USE_TLS = ''
 
SECRET_KEY = 'MY_SECRET_KEY'
TEMPLATE_DIRS = (
  '/srv/kontrolvm/kontrolvm/templates',
)

STATICFILES_DIRS = (
  '/srv/kontrolvm/kontrolvm/static',
)

VNC_HOST = ''

DATABASES = {
   'default': {
       'ENGINE': 'django.db.backends.postgresql_psycopg2',
       'NAME': 'kontrolvm',                      
       'USER': 'kontrolvm',
       'PASSWORD': '*A*PASSWORD*',
       'HOST': 'localhost'
   }
}

Next try and sync the database:

python manage.py syncdb