Overview

CouchShare is a home entertainment server that implements some standard
protocols so that you can share music and video to devices in your living room
so that you can enjoy them from your couch, rather than in front of your desk,
or through relatively poor laptop speakers or screen.

There are some different moving parts that work in concert.

upnp-srv/  A PHP extension that enables multicast udp sockets
content/   put your media, or symlinks to your media, in here.
control/   handles control messages

Installation:

- You need PHP 5.2 or higher, and you need to have build tools
  available for it (the php-devel package on fedora).
  That PHP install must have XML, PDO and PDO SQLite support.
- Install the pecl fileinfo extension
- Set up an alias or otherwise arrange for the "www" dir to be
  handled by your system web server
- restart web server to pick up your config changes
- edit couchshare.ini and set the "http" directive to that location.
  For example, if you have apache set to serve www up as
  http://192.168.0.1:80/couchshare, then you would put:
  http = 192.168.0.1:80/couchshare
  in the [network] section of couchshare.ini
- make && make install # to install multicast udp for php
- populate content with media or symlinks
- php control/re-index.php # to populate db for the first time
- ./couchshare # spawn the server

I have couchshare run from inittab:

cs:2345:respawn:/home/wez/couchshare/trunk/couchshare

and a cronjob to periodically re-index the media:

*/15 * * * * wez ( cd /home/wez/couchshare/trunk ; /usr/local/bin/php control/re-index.php ) >/dev/null 2>&1