I recently installed GNU MediaGoblin to host media content on my own server, on my own terms. MG includes its own webserver for testing, but a proper installation should co-exist with a webserver on a standard port. MG's documentation describes an example FastCGI config for nginx, and the MG wiki describes running with Apache/2. But I don't use nginx or Apache; I run lighttpd. Using the above documents as a guide, here's how I configured lighttpd to serve my MG content via a FastCGI connection. Lighttpd file locations are based on the default Arch Linux lighttpd installation.
/etc/lighttpd/lighttpd.conf:
... include "modules.conf" ...
/etc/lighttpd/modules.conf:
... server.modules = ( "mod_alias", ) include "conf.d/fastcgi.conf" ...
/etc/lighttpd/conf.d/fastcgi.conf:
... $HTTP["host"] == "goblin.thisshitistemp.com" { alias.url = ( "/mgoblin_static" => "/path/to/mediagoblin/mediagoblin/static/" ) alias.url += ( "/mgoblin_media/" => "/path/to/mediagoblin/user_dev/media/public/" ) alias.url += ( "/theme_static/" => "/path/to/mediagoblin/user_dev/theme_static/" ) $HTTP["url"] !~ "^/mgoblin_(.*)" { fastcgi.server = ( "/" => ( "localhost" => ( "host" => "127.0.0.1", "port" => 26543, "check-local" => "disable", "fix-root-scriptname" => "enable", ) ) ) } } ...
$HTTP["host"] == "goblin.thisshitistemp.com" ensures that the rules above are only applied to requests for a specifc host. I run multiple virtual hosts on this machine, so I want to prevent sending requests to other hosts to MG's FastCGI server.
The alias.url lines point the static file requests to their actual locations in the filesystem.
All other requests to the host are passed along to the FastCGI server running on local port 26543.
As for initiating the MG FastCGI server, I'm running a slightly- modified version of Chimo's Arch Linux init script. Thanks, Chimo!