2010-11-28 15:06:48 +00:00
|
|
|
pan.do/ra - open media archive
|
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
for more information on pan.do/ra visit our website at https://pan.do/ra
|
|
|
|
|
2011-11-03 12:32:23 +00:00
|
|
|
== SETUP ==
|
2015-01-05 16:07:55 +00:00
|
|
|
pan.do/ra is known to work with Ubuntu 14.04,
|
2012-10-30 10:23:36 +00:00
|
|
|
but other distributions should also work.
|
2015-01-05 16:07:55 +00:00
|
|
|
The instructions below are for Ubuntu 14.04.
|
2012-10-30 10:23:36 +00:00
|
|
|
All commans given expect that you are root.
|
|
|
|
|
|
|
|
To run pan.do/ra you need to install and setup:
|
|
|
|
python
|
|
|
|
postgres
|
|
|
|
nginx (or apache2)
|
|
|
|
additinal video packages
|
2012-04-19 12:43:54 +00:00
|
|
|
|
2010-11-28 15:06:48 +00:00
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
=== Installing required packages ===
|
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
1) add pandora ppa to get all packages in the required version
|
2012-04-19 12:43:54 +00:00
|
|
|
|
2015-01-05 16:07:55 +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
|
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
2) install all required packages
|
2015-11-14 14:22:40 +00:00
|
|
|
apt-get install git subversion mercurial \
|
2011-10-18 09:08:09 +00:00
|
|
|
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 \
|
2015-01-05 16:07:55 +00:00
|
|
|
poppler-utils mkvtoolnix gpac imagemagick \
|
|
|
|
python-ox oxframe ffmpeg
|
2012-10-30 10:23:36 +00:00
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
=== Prepare Environment ===
|
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
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
|
|
|
|
exit
|
|
|
|
|
|
|
|
3) Setup RabbitMQ
|
2015-01-19 17:52:04 +00:00
|
|
|
You have to use the same password here and in BROKER_URL in local_settings.py
|
2012-10-30 10:23:36 +00:00
|
|
|
|
2015-01-19 17:52:04 +00:00
|
|
|
rabbitmqctl add_user pandora PASSWORD
|
2012-10-30 10:23:36 +00:00
|
|
|
rabbitmqctl add_vhost /pandora
|
|
|
|
rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
|
|
|
|
|
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
=== Install Pan.do/ra ===
|
|
|
|
|
2015-11-14 14:22:40 +00:00
|
|
|
1) Get code from git
|
2012-04-19 12:43:54 +00:00
|
|
|
cd /srv/
|
2016-02-12 08:32:24 +00:00
|
|
|
git clone --depth 1 https://git.0x260.org/pandora.git pandora
|
2010-02-16 10:22:34 +00:00
|
|
|
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
|
|
|
|
2010-11-28 15:06:48 +00:00
|
|
|
cd static
|
2016-02-12 08:32:24 +00:00
|
|
|
git clone --depth 1 https://git.0x2620.org/oxjs.git
|
2009-12-31 15:04:32 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
cd /srv
|
|
|
|
chown -R pandora.pandora pandora
|
2012-03-23 20:57:43 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
2) create local_settings.py and config.jsonc
|
2011-11-03 12:32:23 +00:00
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
2.1) create file /srv/pandora/pandora/local_settings.py with the following content:
|
2012-03-30 14:57:07 +00:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'NAME': 'pandora',
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'USER': 'pandora',
|
2012-10-30 10:23:36 +00:00
|
|
|
'PASSWORD': '',
|
2012-03-30 14:57:07 +00:00
|
|
|
}
|
|
|
|
}
|
2012-10-30 10:23:36 +00:00
|
|
|
DB_GIN_TRGM = True
|
2015-01-19 17:52:04 +00:00
|
|
|
BROKER_URL = 'amqp://pandora:PASSWORD@localhost:5672//pandora'
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
#with apache x-sendfile or lighttpd set this to True
|
|
|
|
XSENDFILE = False
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
#with nginx X-Accel-Redirect set this to True
|
|
|
|
XACCELREDIRECT = True
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
2.2) create config.jsonc
|
2012-10-30 10:23:36 +00:00
|
|
|
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
|
|
|
|
https://wiki.0x2620.org/wiki/pandora/configuration and
|
|
|
|
config.0xdb.jsonc config.padma.jsonc for configuration options.
|
|
|
|
|
|
|
|
3) initialize database
|
|
|
|
su pandora
|
|
|
|
cd /srv/pandora/pandora
|
2015-01-19 15:34:21 +00:00
|
|
|
./manage.py init_db
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
4) install init scripts and start daemons
|
2015-01-19 17:40:32 +00:00
|
|
|
|
|
|
|
/srv/pandora/ctl install
|
2013-07-10 16:14:48 +00:00
|
|
|
/srv/pandora/ctl start
|
2012-10-30 10:23:36 +00:00
|
|
|
|
|
|
|
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/local_settings.py
|
|
|
|
|
|
|
|
service nginx reload
|
2012-04-19 12:43:54 +00:00
|
|
|
|
2012-10-30 10:23:36 +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
|
2015-03-28 18:08:32 +00:00
|
|
|
a2enmod proxy_http
|
2015-04-28 17:35:15 +00:00
|
|
|
a2enmod proxy_wstunnel
|
2012-10-30 10:23:36 +00:00
|
|
|
cp /srv/pandora/etc/apache2/pandora.conf /etc/apache2/sites-available/pandora.conf
|
|
|
|
a2ensite pandora
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
#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/local_settings.py
|
|
|
|
|
|
|
|
service apache2 reload
|
2010-11-28 15:06:48 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
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
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
== Updating ==
|
2015-01-19 17:52:04 +00:00
|
|
|
To update pandora to the latest version run this:
|
2012-11-16 01:27:09 +00:00
|
|
|
su pandora
|
|
|
|
cd /srv/pandora
|
|
|
|
./update.py
|
2012-03-23 20:57:43 +00:00
|
|
|
|
|
|
|
this will update pandora/oxjs/python-ox and list possible upgrades to the db
|
|
|
|
|
2015-01-05 16:07:55 +00:00
|
|
|
to update your database run:
|
2012-10-30 10:23:36 +00:00
|
|
|
su pandora
|
2015-01-05 16:07:55 +00:00
|
|
|
cd /srv/pandora
|
|
|
|
./update.py db
|
2012-10-30 10:23:36 +00:00
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
== Development ==
|
2012-03-23 20:57:43 +00:00
|
|
|
in one terminal:
|
2014-04-09 15:01:00 +00:00
|
|
|
./manage.py runserver 2620
|
2012-03-30 14:57:07 +00:00
|
|
|
|
|
|
|
and background task in another:
|
2014-04-09 14:54:37 +00:00
|
|
|
./manage.py celeryd -B -Q celery,default,encoding -l INFO
|
2012-03-30 14:57:07 +00:00
|
|
|
|
2012-10-30 10:23:36 +00:00
|
|
|
now you can access your local pandora instace at http://127.0.0.1:8000/
|
|
|
|
|
2015-01-19 15:34:21 +00:00
|
|
|
we use virtual machines/lxc for development, you can get a vm from our site
|
2012-10-30 10:23:36 +00:00
|
|
|
or use the script in vm/build.sh to create one.
|