163 lines
4.9 KiB
Raw Normal View History - open media archive
for more information on visit our website at
== SETUP == is known to work with Ubuntu 14.04,
but other distributions should also work.
The instructions below are for Ubuntu 14.04.
All commans given expect that you are root.
To run you need to install and setup:
nginx (or apache2)
additinal video packages
2012-04-19 12:43:54 +00:00
* Installing required packages
1) add pandora ppa to get all packages in the required version
2012-04-19 12:43:54 +00:00
apt-get install software-properties-common
2011-12-19 19:42:18 +00:00
add-apt-repository ppa:j/pandora
apt-get update
2) install all required packages
apt-get install bzr git subversion mercurial \
python-setuptools python-pip python-virtualenv ipython \
2011-12-03 16:17:07 +00:00
python-dev python-imaging python-numpy python-psycopg2 \
2011-12-26 14:30:30 +00:00
python-geoip python-html5lib python-lxml \
2012-04-19 12:43:54 +00:00
postgresql postgresql-contrib rabbitmq-server \
poppler-utils mkvtoolnix gpac imagemagick \
python-ox oxframe ffmpeg
* Prepare Environment
1) add pandora user and set permissions
adduser pandora --disabled-login --disabled-password
2) Setup Database
su postgres
createuser pandora
createdb -T template0 --locale=C --encoding=UTF8 -O pandora pandora
echo "CREATE EXTENSION pg_trgm;" | psql pandora
3) Setup RabbitMQ
Important: "use_your_own" is a password and you have to use the same value here and below for BROKER_URL
rabbitmqctl add_user pandora use_your_own
rabbitmqctl add_vhost /pandora
rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
* Install
1) Get code from bazzar
2012-04-19 12:43:54 +00:00
cd /srv/
2010-07-03 11:14:16 +00:00
bzr branch pandora
cd pandora
2012-05-17 09:38:59 +00:00
virtualenv --system-site-packages .
2013-04-06 17:22:01 +00:00
./bin/pip install -r requirements.txt
2009-12-31 15:04:32 +00:00
cd static
bzr branch
2009-12-31 15:04:32 +00:00
cd /srv
chown -R pandora.pandora pandora
2) create and config.jsonc
1) create file /srv/pandora/pandora/ with the following content:
'default': {
'NAME': 'pandora',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'pandora',
2015-01-19 10:45:49 +00:00
BROKER_URL = 'amqp://pandora:use_your_own@localhost:5672//pandora'
#with apache x-sendfile or lighttpd set this to True
#with nginx X-Accel-Redirect set this to True
2) create config.jsonc
config.jsonc holds the configuration for your site.
To start you can copy /srv/pandora/pandora/config.pandora.jsonc
to /srv/pandora/pandora/config.jsonc but have a look at and
config.0xdb.jsonc config.padma.jsonc for configuration options.
3) initialize database
su pandora
cd /srv/pandora/pandora
./ syncdb --noinput
./ migrate item
./ migrate annotation
2012-11-27 15:10:17 +00:00
./ migrate
./ sqlfindindex
2012-11-27 15:10:17 +00:00
./ sync_itemsort
./ collectstatic -l --noinput
./ update_static
./ compile_pyc
4) install init scripts and start daemons
cp /srv/pandora/etc/init/*.conf /etc/init/
2013-07-10 16:14:48 +00:00
/srv/pandora/ctl start
5) Setup Webserver
a) nginx (recommended)
apt-get install nginx
cp /srv/pandora/etc/nginx/pandora /etc/nginx/sites-available/pandora
cd /etc/nginx/sites-enabled
ln -s ../sites-available/pandora
#read comments in /etc/nginx/sites-available/pandora for setting
#your hostname and other required settings
#make sure XACCELREDIRECT = True in /srv/pandora/pandora/
service nginx reload
2012-04-19 12:43:54 +00:00
b) apache2 (if you need it for other sites on the same server)
apt-get install apache2-mpm-prefork libapache2-mod-xsendfile
a2enmod xsendfile
cp /srv/pandora/etc/apache2/pandora.conf /etc/apache2/sites-available/pandora.conf
a2ensite pandora
#read comments in /etc/apache2/sites-available/pandora.conf for setting
#your hostname and other required settings
#make sure XSENDFILE = True in /srv/pandora/pandora/
service apache2 reload
Now you can open pandora in your browser, the first user to sign up will become admin.
2009-12-31 15:04:32 +00:00
=== Updating ===
To update a pandora installation get the latest version from bzr by running
2012-11-16 01:27:09 +00:00
su pandora
cd /srv/pandora
this will update pandora/oxjs/python-ox and list possible upgrades to the db
to update your database run:
su pandora
cd /srv/pandora
./ db
=== Development ===
in one terminal:
./ runserver 2620
and background task in another:
./ celeryd -B -Q celery,default,encoding -l INFO
now you can access your local pandora instace at
we use virtual machines for development, you can get a vm from our site
or use the script in vm/ to create one.