Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Description

...

of

...

how

...

to

...

install

...

the

...

software

...

needed

...

for

...

Lobber.

Page index
  1. Common
  2. Web application and tracker server
  3. Storage node
  4. Database server
  5. Development sandbox

Anchor
common
common

Common

All hosts are running Ubuntu (10.04)

...

with

...

the

...

following

...

extra

...

packages

...

and

...

customizations.

Code Block


h2. Common to all

{code}
apt-get install git-core git-doc ssl-cert gitpython-core virtualenv
{
Code Block

}

{code}
apt-get install postfix
# local only configuration!
{code}

h2. Web application server

{

Anchor
webapp
webapp

Web application and tracker server

Install the following packages:

Code Block
code}
apt-get install apache2 libapache2-mod-wsgi libapache2-mod-shib2
{code}

You might need these:
{code}
python-egenix-mxdatetime python-egenix-mxtools python-pycurl python-openssl python-twisted
{code}

Set up a virtual python environment ([virtualenv|http://pypi.python.org/pypi/virtualenv]) and activate it.
{code} libpq-dev python-dev python-twisted python-pip

If you don't want to install libpq-dev and python-dev you can install psycopg2 with apt and later symlink it to your virtual python environment.

Code Block

ln -s /usr/lib/python2.6/dist-packages/psycopg2 /path/to/lobber_env/lib/python2.6/site-packages
ln -s /usr/lib/python2.6/dist-packages/mx /path/to/lobber_env/lib/python2.6/site-packages
ln -s /usr/lib/python2.6/dist-packages/psycopg2-2.0.13.egg-info /path/to/lobber_env/lib/python2.6/site-packages

Orbited can not be installed in the lobber python environment because it requires python-twisted.

Code Block

pip install orbited

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

Code Block
virtualenv --no-site-packages /path/to/lobber_env
source /path/to/lobber_env/bin/activate
{code}

Install

...

the

...

needed

...

python

...

applications. (Yes, orbited again...needed as import in django)

Code Block
.
{code}
pip install django django-tagging django-form-utils orbited stomp.py psycopg2 orbited

You need these if you are setting up a development sandbox:

Code Block

{code}

You might need these:
{code}
pip install uuid django-evolution django-extensions werkzeug
{code}

Get Lobber from  django-debug-toolbar

Get Lobber from git.nordu.net

...

and

...

check

...

out

...

the

...

latest

...

stable

...

version.

{
Code Block
}
git clone git@gitgit://git.nordu.net:/lobber.git
cd lobber
git checkout bud-light
{code}

Create

...

the

...

a log, torrent and a dropbox directory in the lobber root directory. Make the writable by the Apache user.

Code Block

cd /path/to/lobber/
mkdir logs
mkdir torrents
mkdir dropbox

Symlink the environment directory and Django admin media directory in to the src directory.

Code Block

cd  log directory and symlink the environment directory and Django admin media directory in to the lobber directory.
{code}
/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
{code}

Edit

...

paths

...

and

...

other

...

options

...

in

...

settings.py.

Code Block
titlesettings.py

BASE_DIR = '/path/to/lobber'

APP_ADDR = 'host_ip or FQDN'
BASE_UI_URL = 'https://' + APP_ADDR

{code}
TRACKER_ADDR = 'localhost'

host_ip or FQDN'
ANNOUNCE_BASE_URL = 'https://' + TRACKER_ADDR

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 = '/dirpath/writable/by/apache/userto/lobber/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'
)

If you are using Django 1.3 (standard from pip) then you need to change your database settings to:

Code Block
titlesettings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'lobber',
        'USER': 'lobber',
        'PASSWORD': 'secret',
        'HOST': 'database_server',
        'PORT': 'database_port'
    }
}

Synchronize the database.

Code Block
{code}

Synchronize the database.
{code}
./dev-django-admin.sh syncdb
{code}

Setup [Orbited|http://orbited.org] by creating {{

Setup Orbited by creating /etc/orbited.cfg

...

:

{|=
Code Block
title
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
{code}

and

...

make

...

sure

...

that

...

orbited

...

is

...

started

...

like

...

this

...

automatically

...

at

...

boot:

Code Block

 {{echo "orbited -c /etc/orbited.cfg" >> /etc/rc.local

Then start orbited:

Code Block

orbited -c /etc/orbited.cfg &

Activate some Apache modules:

Code Block

a2enmod shib2
a2enmod headers
a2enmod rewrite
a2enmod proxy
a2enmod proxy_http

Restart Apache

Code Block

/etc/init.d/apache2 restart

Edit lobber/src/lobber.wsgi:

Code Block
titlelobber.wsgi

sys.path.append('/path/to/lobber/src')

Create /etc/apache2/conf.d/lobber:

Code Block
titlelobber

WSGIPythonPath "/path/to/lobber:/path/to/lobber/src"
WSGIPythonHome "/path/to/lobber/src/env"
WSGIRestrictStdout Off
WSGIScriptAlias / /path/to/lobber/src/lobber.wsgi

Edit /etc/apache2/sites-available/default-ssl:

Code Block
titledefault

Alias /admin-media /path/to/lobber/admin-media
Alias /site-media /path/to/lobber/site-media

Documentation on how to set up Apache to handle https can be found here:

  1. http://www.tc.umn.edu/~brams006/selfsign.html
  2. http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html

Usual problems:

  • /path/to/lobber/logs/web.log is not writable by www-data (apache user).
  • /path/to/lobber/torrents/ is not writable by www-data (apache user).
  • /path/to/lobber/dropbox/ is not writable by www-data (apache user).
  • /path/to/lobber/db/ (if you are using sqlite) is not writable by www-data (apache user).
Info
titleMissing documentation

Documentation on how to set up federated login using mod_shib2 should be added or linked to.

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

Code Block

PATH=/usr/bin:/usr/sbin:/path/to/lobber/src/env/bin}}

You might need:
{code}
pip install stompservice
{code}

Activate some Apache modules:
{code}
# a2enmod shib2
# a2enmod headers
# a2enmod rewrite
# a2enmod proxy
# a2enmod proxy_http
{code}

Set up cron jobs for expiring old torrents, keys and peers.  
{code}
# 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 
{code}

h2. Storage node

See [Running a storage node]

Note that app-dev is a storage node too nowadays -- that's how we do file upload.

h2. Database

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.

Anchor
storagenode
storagenode

Storage node

See Running a storage node (bud light)

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

Anchor
database
database

Database server

Code Block
 server

{code}
apt-get install  postgresql-client-8.4
{code}

h2. Setting up your own sandbox
# apt-get install virtualenv
# virtualenv 

Look at the official Django database documentation.

Anchor
devsandbox
devsandbox

Setting up your own development sandbox

  1. apt-get install python-virtualenv
  2. virtualenv /mina/envs/lobber

...

  1. .

...

  1. /mina/envs/lobber/bin/activate

...

  1. pip

...

  1. install

...

  1. django

...

  1. django-extensions

...

  1. django-tagging

...

  1. orbited

...

  1. uuid

...

  1. django-evolution

...

  1. stomp.py

...

  1. werkzeug

...

  1. psycopg2

...

  1. git

...

  1. clone

...

  1. git@git.nordu.net:lobber.git

...

  1. (alt.

...

  1. git

...

  1. pull)

...

  1. cd

...

  1. lobber

...

  1. git

...

  1. checkout <branch>
  2. mkdir db
  3. mkdir logs
  4. cd src
  5. ./dev-django-admin.sh

...

  1. syncdb

...

  1. ln

...

  1. -s

...

  1. /mina/envs/lobber

...

  1. env

...

  1. ln

...

  1. -s

...

  1. env/lib/python2.6/site-packages/django/contrib/admin/media

...

  1. admin-media

...

  1. Edit

...

  1. paths

...

  1. in

...

  1. settings.py

...

  1. ./dev-django-admin.sh

...

  1. runserver_plus

...