You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Description of how to install the software needed for Lobber.

Hosts

Hostname

Use

Web application and tracker server

Database server

Storage Node

All hosts are running Ubuntu (10.04) with the following extra packages and customizations.

Common to all

apt-get install git-core git-doc ssl-cert git-core python-virtualenv
apt-get install postfix
# local only configuration!

Web application and tracker server

apt-get install apache2 libapache2-mod-wsgi libapache2-mod-shib2 libpq-dev python-dev

You might need these:

python-egenix-mxdatetime python-egenix-mxtools python-pycurl python-openssl python-twisted

Set up a virtual python environment (virtualenv) and activate it.

virtualenv --no-site-packages /path/to/lobber_env
source /path/to/lobber_env/bin/activate

Install the needed python applications.

pip install django django-tagging django-form-utils orbited stomp.py psycopg2

You might need these:

pip install uuid django-evolution django-extensions werkzeug

Get Lobber from git.nordu.net and check out the latest stable version.

git clone git@git.nordu.net:lobber.git
cd lobber
git checkout bud-light

Create the a log directory and symlink the environment directory and Django admin media directory in to the lobber directory.

/path/to/lobber/
mkdir logs
cd src
ln -s /path/to/lobber_env env
ln -s env/lib/python2.6/site-packages/django/contrib/admin/media admin-media

Edit paths and other options in settings.py.

settings.py
APP_ADDR = 'host_ip'
TRACKER_ADDR = 'host_ip'

ADMINS = (
    ('Your name', 'your@email.net'),

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'lobber'
DATABASE_USER = 'lobber'
DATABASE_PASSWORD = 'secret_password'
DATABASE_HOST = 'database host'
DATABASE_PORT = 'database port'

DROPBOX_DIR = '/dir/writable/by/apache/user/dropbox'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'secret'

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',      # For the Permission model.
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'tagging',
    'lobber.extensions',
    'lobber.userprofile',
    'lobber.share',
    'lobber.links',
    'lobber.tracker',
    'lobber.auth'
)

Synchronize the database.

./dev-django-admin.sh syncdb

Setup Orbited by creating /etc/orbited.cfg:

orbited.cfg
[listen]
http://:9001
stomp://:61613

[access]
* -> localhost:61613

[static]

[global]
session.ping_interval = 300
user=www-data

[logging]
debug=STDERR,debug.log
info=STDERR,info.log
access=STDERR,info.log
warn=STDERR,error.log
error=STDERR,error.log

#Don't enable debug by default
enabled.default=info,access,warn,error

and make sure that orbited is started like this automatically at boot: echo "orbited -c /etc/orbited.cfg" >> /etc/rc.local

You might need:

pip install stompservice

Activate some Apache modules:

# a2enmod shib2
# a2enmod headers
# a2enmod rewrite
# a2enmod proxy
# a2enmod proxy_http

Set up cron jobs for expiring old torrents, keys and peers.

# m h dom mon dow command
*/5 * * * * cd /path/to/lobber/src/ && ./dev-django-admin.sh expire_peers 5 /dev/null 2>&1
0 0 * * * cd /path/to/lobber/src/ && ./dev-django-admin.sh expire_torrents >/dev/null 2>&1
5 0 * * * cd /path/to/lobber/src/ && ./dev-django-admin.sh expire_keys >/dev/null 2>&1 

To be able to accept file uploads in the Lobber web application you need to install a Lobber storage node on the web application and tracker server.

Storage node

See Running a storage node

Note that the web application and tracker server needs a storage node nowadays – that's how we do file upload.

Database server

apt-get install postgresql-client-8.4

Setting up your own sandbox

  1. apt-get install python-virtualenv
  2. virtualenv /mina/envs/lobber
  3. . /mina/envs/lobber/bin/activate
  4. pip install django django-extensions django-tagging orbited uuid django-evolution stomp.py werkzeug psycopg2
  5. git clone git@git.nordu.net:lobber.git (alt. git pull)
  6. cd lobber
  7. git checkout <branch>
  8. mkdir db
  9. mkdir logs
  10. cd src
  11. ./dev-django-admin.sh syncdb
  12. ln -s /mina/envs/lobber env
  13. ln -s env/lib/python2.6/site-packages/django/contrib/admin/media admin-media
  14. Edit paths in settings.py
  15. ./dev-django-admin.sh runserver_plus
  • No labels