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: