Run Wowza Media Server as a Non-root User on Linux

I recently had an interesting scenario where I needed to run Wowza as a non-root user in order to keep file permissions the same across a number of servers, as I was recording video on one server and serving it over VOD on another.

Unix Permissions have always seriously confused me and vexed me to no end, but I found that the actual Wowza Media Server User’s Guide gives instructions on how to run the server as non-root. For a given user user with a primary group of user:

chown user:user /usr/local/WowzaMediaServer
chown -R user:user /usr/local/WowzaMediaServer-2.2.4
chmod -R 775 /usr/local/WowzaMediaServer-2.2.4
rm -f /var/run/WowzaMediaServer.lock /var/run/

If you’re a l33t h4ck3r like me, you can combine the last line like:

rm -f /var/run/WowzaMediaServer.{lock,pid}

…but only if you’re using Bash.

After you do this, modify both /usr/local/WowzaMediaServer/bin/ and /usr/local/WowzaMediaServer/bin/ to prepend sudo -u user to the 24th (or last) line. Basically, for the line that starts with $_EXECJAVA ..., it should now start with sudo -u user $_EXECJAVA ....

I’ve also put the Wowza docs on my Google Docs account so as to make them a lot easier to access. Find them below:

[Tutorial] Getting a SSH client and server working on CyanogenMod

I’ve had to do this a few times already on my Nexus One, so I thought I’d tutorialize it for the greater good. Basically, if you haven’t heard already, CyanogenMod is like the greatest thing to ever happen to Android. It provides a ton of goodies and really nice things that make your phone more powerful by an order of magnitude. It includes BusyBox, which is basically a really lightweight version of all of the core Linux/Unix utilities like “cp,” “mv,” “gcc,” and more. Importantly, CyanogenMod includes the DropBear SSH client and server.

Continue reading