Inhaltsverzeichnis
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
install nginx and all prerequisites for this setup:
aptitude install mpd fookebox uwsgi uwsgi-plugin-python nginx
put the following lines into /etc/uwsgi/apps-available/fookebox.ini:
[uwsgi] socket = 127.0.0.1:3031 file = /etc/fookebox/fookebox.wsgi
Provide fookebox at domain level
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; }
Provide fookebox below domain level
sections:
location /javascript { alias /usr/share/javascript; } location /fookebox { uwsgi_pass 127.0.0.1:3031; uwsgi_param SCRIPT_NAME /fookebox; include uwsgi_params; uwsgi_modifier1 30; }
The uwsgi_modifier1 setting takes care for removing SCRIPT_NAME from PATH_INFO before passing it to the uwsgi server.