Wiki Markup |
---|
Description of how to install the software needed for Lobber. |
...
Hosts
Hostname | Use |
---|---|
app-dev.lobber.se | Web application server |
db-dev.lobber.se | PgSQL server |
tracker-dev.lobber.se | BT Tracker |
sn-dev.lobber.se | Storage Node |
All hosts are running Ubuntu (9.10 from day 0) with the following extra packages and customizations.
common to all
Code Block |
---|
h1. 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. h2. common to all {code} apt-get install git-core git-doc ssl-cert git-core |
Code Block |
virtualenv
{code}
{code}
apt-get install postfix
# local only configuration!
|
app-dev.lobber.se
Code Block |
---|
{code} h2. Web application server {code} apt-get install python-django apache2 libapache2-mod-shib2wsgi python-libtorrent \ python-bittorrent python-django-doc python-libapache2-mod-shib2 {code} You might need these: {code} python-egenix-mxdatetime python-egenix-mxtools \ python-psycopg2 python-pycurl python-openssl postgresql-client-8.4 python-twisted \ python-setuptools python-pysqlite2 libapache2-mod-python python-django-tagging \ python-werkzeug python-django-extensions python-django-evolution deluge-common |
python-setuptools gives us easy-install which we use for installing some stuff not packaged in Debian packages:
Code Block |
---|
# easy_install orbited
# easy_install stompservice
|
Get a 3.x version of stomp.py from http://code.google.com/p/stomppy/ and install:
Create /etc/orbited.cfg
:
Code Block |
---|
{code}
Set up a virtual python environment ([virtualenv|http://pypi.python.org/pypi/virtualenv]) and activate it.
{code}
virtualenv --no-site-packages /path/to/lobber_env
source /path/to/lobber_env/bin/activate
{code}
Install the needed python applications.
{code}
pip install django django-tagging django-form-utils orbited stomp.py psycopg2
{code}
You might need these:
{code}
pip install uuid django-evolution django-extensions werkzeug
{code}
Get Lobber from git.nordu.net and check out the latest stable version.
{code}
git clone git@git.nordu.net:lobber.git
cd lobber
git checkout bud-light
{code}
Create the a 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}
TRACKER_ADDR = 'localhost'
ADMINS = (
('Your name', 'your@email.net'),
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'lobber'
DATABASE_USER = 'lobber'
DATABASE_PASSWORD = 'secret_password'
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'
)
{code}
Synchronize the database.
{code}
./dev-django-admin.sh syncdb
{code}
Setup [Orbited|http://orbited.org] by creating {{/etc/orbited.cfg}}:
{code|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
|
och se till att orbited startas: orbited -c /etc/orbited.cfg
vid boot (/etc/rc.local till nöds)
...
{code} and make sure that orbited is started like this automatically at boot: {{echo "orbited -c /etc/orbited.cfg |
...
Activate some Apache modules:
Code Block |
---|
" >> /etc/rc.local}} 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 Block |
---|
{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 |
Finally, make sure that Lobber can send email. This is done via STOMP messages to a twisted. Run this (in the src directory):
Code Block |
---|
# env PYTHONPATH=`pwd`:$PYTHONPATH twistd -y sendmail.tac
|
sn-dev.lobber.se
Note that app-dev is a storage node too nowadays – that's how we do file upload.
db-dev.lobber.se
Code Block |
---|
{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 server {code} apt-get install postgresql |
Setting up your own sandbox
-client-8.4 {code} h2. Setting up your own sandbox # apt-get install virtualenv |
...
# virtualenv /mina/envs/lobber |
...
# . /mina/envs/lobber/bin/activate |
...
# pip install django django-extensions django-tagging orbited uuid django-evolution stomp.py |
...
werkzeug psycopg2 # git clone git@git.nordu.net:lobber.git (alt. git pull) |
...
# cd lobber |
...
# git checkout embedded-tracker |
...
# mkdir db |
...
# mkdir logs |
...
# cd src |
...
# ./dev-django-admin.sh syncdb |
...
# ln -s /mina/envs/lobber env |
...
# ln -s env/lib/python2.6/site-packages/django/contrib/admin/media admin-media |
...
# Edit paths in settings.py |
...
# ./dev-django-admin.sh runserver_plus |