Unterschiede zwischen den Revisionen 1 und 2
Revision 1 vom 2012-12-06 01:55:19
Größe: 1161
Autor: anonym
Kommentar: describe fookebox with uWSGI and mpd
Revision 2 vom 2012-12-06 02:31:23
Größe: 1736
Autor: anonym
Kommentar: added nginx setup
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 25: Zeile 25:
uid = media
gid = media
Zeile 36: Zeile 34:

= Setup with nginx =
{{{
aptitude install mpd fookebox uwsgi uwsgi-plugin-python nginx
}}}
 * remove the section ''location /'' from {{{/etc/nginx/sites-enabled/default}}} and replace it with the following two sections: {{{
location /javascript { alias /usr/share/javascript; }
location / {
    root html;
    uwsgi_pass 127.0.0.1:3031;
    uwsgi_param SCRIPT_NAME /;
    include uwsgi_params;
}
}}}
 * put the following lines into {{{/etc/uwsgi/apps-available/fookebox.ini}}}: {{{
[uwsgi]
socket = 127.0.0.1:3031
file = /etc/fookebox/fookebox.wsgi
}}}

Overview

MPD
a daemon used for playing music stored in a local directory
fookebox
python-based web interface serves as a remote control for MPD
uWSGI

this web server is specifically designed for the uWSGI protocol

Setup

aptitude install mpd fookebox uwsgi uwsgi-plugin-http uwsgi-plugin-python

MPD

  • configure music_directory in /etc/mpd.conf

  • restart mpd: invoke-rc.d mpd

fookebox

  • configure music_base_path in /etc/fookebox/config.ini

uWSGI

  • create the service file in /etc/uwsgi/apps-available/fookebox.ini:

    [uwsgi]
    http = :8000
    file = /etc/fookebox/fookebox.wsgi
    static-map = /javascript=/usr/share/javascript
    workers = 5
    • BEWARE: the above definition of static-map is important - otherwise common javascript files (e.g. prototyp/prototype.js) are not found. This would render the web interface unusable.

  • enable the uWSGI service:

    ln -s ../apps-available/fookebox.ini /etc/uwsgi/apps-enabled/
  • restart uWSGI: invoke-rc.d uwsgi

Setup with nginx

aptitude install mpd fookebox uwsgi uwsgi-plugin-python nginx
  • remove the section location / from /etc/nginx/sites-enabled/default and replace it with the following two sections:

    location /javascript { alias /usr/share/javascript; }
    location / {
        root            html;
        uwsgi_pass      127.0.0.1:3031;
        uwsgi_param     SCRIPT_NAME /;
        include         uwsgi_params;
    }
  • put the following lines into /etc/uwsgi/apps-available/fookebox.ini:

    [uwsgi]
    socket = 127.0.0.1:3031
    file = /etc/fookebox/fookebox.wsgi

Fookebox by uWSGI (zuletzt geändert am 2012-12-18 00:46:45 durch anonym)


Creative Commons Lizenzvertrag
This page is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.