1

Here's the key background info:

  1. I've got an Asus RT-N56U router.
  2. Attached to the router is a USB hard disk with a bunch of music on it.
  3. The music is accessible to devices on my LAN over uPnP/DLNA; this works great.
  4. My WAN connection is provisioned at 100 Mbps down / 40 Mbps up.
  5. I want to use some of that upstream bandwidth to stream my music to myself wherever I happen to be.
  6. I could but don't want to leave a server running on my network 24/7 to accomplish this when the router is already able to share the content locally.

So what I want is some way to make the content that the router is already able to distribute across the LAN accessible over the Internet as well. I've looked around but haven't found any prebuilt solutions to this that don't involve hosting the content on a server behind the router, which I'd like to avoid.

The router does have built-in support for serving up the content over FTP, but I've tried that and found that it really does not play well with media players. It kind of works, but the seek time when switching between tracks is absurd, and some tracks just plain fail.

One thought I've had is serving up the content over HTTP by installing an Apache instance on the router (and/or editing the configuration of the built-in instance that provides the configuration portal, if that's possible?). The router appears to run some trimmed-down version of Linux (I can telnet/ssh into it, it has a filesystem, package manager, and similar things).

Has anyone set something like this up before? If so, how did you accomplish it? Or if not, what do you suggest I try?

1 Answer 1

0

Okay, I think I got it.

First I installed Lighttpd, php5, and mysql on the router by following the instructions here: http://wpte.kicks-ass.net/forum/showthread.php?tid=1

Then I looked around for PHP-based media servers that would work with the router, and found Zina. Well actually, the first one I found was Streamline, but that one required php-iconv, which I couldn't get installed onto the router.

Installing Zina was pretty straightforward, pretty much all I had to do was set up the DB options and fix the default URL path/document root so that images/stylesheets/similar things would load correctly.

I noticed that the Zina server wasn't accessible from external hosts, however, so I added the following iptables rule on the router:

iptables -I INPUT 1 -p tcp --dport 33333 -j ACCEPT

...33333 is the port I configured Lighttpd to listen on. Alternately, completely disabling the router's firewall also caused the media server to be accessible from external IP's, though I don't recommend that approach.

Right now the only issues remaining are:

  1. Zina appears to allow unauthenticated access to the audio files.
  2. I need to ensure my custom iptables rule will be applied automatically when the router reboots.

That first one is kind of a big deal. Maybe I can fix it by enabling mod_auth on Lighttpd.

Edit: mod_auth did the trick.

Edit 2: I also ended up modifying some of the zina source code to write <user>:<password>@ into the playlist URL's that it generates. Stops media players that don't know how to remember account details from prompting for a username/password every time a new song starts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .