Unterschiede zwischen den Revisionen 2 und 3
Revision 2 vom 2012-12-06 02:31:23
Größe: 1736
Autor: anonym
Kommentar: added nginx setup
Revision 3 vom 2012-12-18 00:46:45
Größe: 2270
Autor: anonym
Kommentar: add nginx setup for applications below domain level
Gelöschter Text ist auf diese Art markiert. Hinzugefügter Text ist auf diese Art markiert.
Zeile 1: Zeile 1:
<<TableOfContents()>>
Zeile 36: Zeile 38:
{{{  * install nginx and all prerequisites for this setup: {{{
Zeile 39: Zeile 41:
 * remove the section ''location /'' from {{{/etc/nginx/sites-enabled/default}}} and replace it with the following two sections: {{{  * put the following lines into {{{/etc/uwsgi/apps-available/fookebox.ini}}}: {{{
[uwsgi]
socket = 127.0.0.1:3031
file = /etc/fookebox/fookebox.wsgi
}}}

== P
rovide fookebox at domain level ==
R
emove the section ''location /'' from {{{/etc/nginx/sites-enabled/default}}} and replace it with the following two sections: {{{
Zeile 48: Zeile 57:
 * 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 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;
}
Zeile 53: Zeile 68:

The ''uwsgi_modifier1'' setting takes care for removing SCRIPT_NAME from PATH_INFO before passing it to the ''uwsgi'' server.

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.

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.