update docs and example nginx/apache config

This commit is contained in:
j 2010-11-28 16:06:48 +01:00
parent 40e537a027
commit 5d205f2aee
5 changed files with 63 additions and 49 deletions

87
README
View file

@ -1,56 +1,67 @@
To setup a local instance of pandora:
pan.do/ra - open media archive
== DEVELOPMENT ==
To setup a development instance of pan.do/ra,
you need python, bazaar, pip and virtualenv and several other python modules:
* Packages
apt-get install python-setuptools python-pip python-virtualenv ipython
apt-get install python-dev python-imaging python-numpy python-psycopg2 python-pip python-vir
bzr branch http://code.0x2620.org/pandora pandora
cd pandora
virtualenv .
pip -E . install -r requirements.txt
cd static
bzr branch http://code.0x2620.org/oxjs
you need python, bazaar, pip and virtualenv:
* Additional pandora tools:
You need current versions of mkvtoolnix, oxframe, oxtimeline installed.
For Ubuntu we provide these packages in a ppa:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:j/pandora
sudo add-apt-repository ppa:gstreamer-developers/ppa
sudo apt-get update
sudo apt-get install oxframe oxtimeline mkvtoolnix
apt-get install python-setuptools bzr
easy_install pip
pip install virtualenv
apt-get install python-dev python-imaging python-numpy
* Database
We use postgresql but other databases might also work
(make sure you have the python bindings installed).
also it uses system python moduels, so make sure you have
ipython, dbmodule(psycopg2, python-mysqldb,..)
installed via apt-get/pip/easy_install in your system path.
create a postgresql database and adjust settings in local_settings.py
and run python manage.py syncdb to populate the database
you might want to load example configurations from fixutes.
Install rabbitmq and carrot:
* RabbitMQ
For background tasks we use RabbitMQ, to install rabbitmq:
sudo apt-get install rabbitmq-server
and create permissions according to BROKER_* in local_settings.py i.e.:
sudo rabbitmqctl add_user pandora box
sudo rabbitmqctl add_vhost /pandora
sudo rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
update BROKER_* settings in local_settings.py:
get current oxjs
cd static
bzr branch http://code.0x2620.org/oxjs
Database:
with postresql install python-psycopg2
Development:
we are using django, http://docs.djangoproject.com/en/dev/
Nginx setup:
sudo apt-get install nginx
or if you use apache:
sudo apt-get install libapache2-mod-xsendfile
add pandora repository:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:j/pandora
sudo add-apt-repository ppa:gstreamer-developers/ppa
sudo apt-get update
sudo apt-get install oxtools mkvtoolnix
H264:
install ffmpeg with x264 enabled, install qt-faststart from (ffmpeg/tools)
* H264
to support h264 videos, install ffmpeg with x264 enabled,
install qt-faststart from (ffmpeg/tools)
set VIDEO_H264 = True in local_settings.py
Running developer environment:
in one terminal:
python manage.py runserver
and in another one:
python manage.py celeryd -Q default,encoding
== DEPLOYMENT ==
To run pan.do/ra in production, we use nginx, using apache2 is also possible.
* nginx setup
sudo apt-get install nginx
* apache2 setup
sudo apt-get install apache2-mpm-prefork
sudo apt-get install libapache2-mod-xsendfile

View file

@ -14,16 +14,18 @@
</Location>
Alias /.bzr __PREFIX__/.bzr
Alias /static __PREFIX__/pandora/static
Alias /favicon.ico __PREFIX__/pandora/static/favicon.ico
Alias /media __PREFIX__/pandora/media
Alias /static __PREFIX__/static
Alias /favicon.ico __PREFIX__/static/favicon.ico
Alias /data __PREFIX__/data
Alias /admin/media __PREFIX__/src/django/django/contrib/admin/media
Alias /static/js/jquery.js __PREFIX__/src/django/django/contrib/admin/media/js/jquery.min.js
WSGIScriptAlias / __PREFIX__/wsgi/django.wsgi
WSGIDaemonProcess pandora user=pandora group=pandora threads=25 python-path=__PREFIX__/lib/python2.6/site-packages/
WSGIProcessGroup pandora
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/.bzr
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} !^/data
RewriteCond %{REQUEST_URI} !^/admin/media
RewriteRule ^/(.*) http://127.0.0.1:2620/$1 [P]
ServerSignature Off
</VirtualHost>

View file

@ -13,5 +13,5 @@ env USER=pandora
script
cd $VENV/pandora
exec sudo -u $USER $VENV/bin/gunicorn_django -b 127.0.0.1:8083 -w5 $VENV/pandora/settings.py
exec sudo -u $USER $VENV/bin/gunicorn_django -b 127.0.0.1:2620 -w5 $VENV/pandora/settings.py
end script

View file

@ -10,16 +10,16 @@ server {
autoindex on;
}
location /favicon.ico {
root __PREFIX__/pandora/static;
root __PREFIX__/static;
}
location /static {
root __PREFIX__/pandora;
location /static/ {
root __PREFIX__;
autoindex on;
}
location /media/ {
location /data/ {
internal;
root __PREFIX__/pandora/;
root __PREFIX__;
}
location / {
@ -28,7 +28,7 @@ server {
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1:8083;
proxy_pass http://127.0.0.1:2620;
break;
}
}
@ -44,6 +44,6 @@ server {
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location /50x.html {
root __PREFIX__/pandora/static;
root __PREFIX__/static;
}
}

View file

@ -11,7 +11,8 @@ if(typeof(console)=='undefined') {
console.log = function() {};
}
</script>
<script type="text/javascript" src="/static/oxjs/build/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/static/js/jquery/jquery.js"></script>
<script type="text/javascript" src="/static/js/jquery/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="/static/js/jquery/jquery.videosupport.js"></script>
<script type="text/javascript" src="/static/oxjs/build/js/ox.load.js"></script>
<script type="text/javascript" src="/static/oxjs/build/js/ox.js"></script>