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:

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

  1. Pingback: TK Kocheran

  2. Hi,
    I’m trying to run Wowza inside php (the default user for apache is www-data) on Ubuntu server 12.04. I added this user to as you mentioned above and no more receive the “/var/run/WowzaMediaServer permission denied” error.
    But still there is another problem, when I start Wowza service from apache, and shut the Wowza server down via command line as root user and restart it as root, then shut it down again, and restart the service using apache, I get the “address already in use” error and Wowza keeps working with it’s last configuration, even with an empty Startupstream.xml file. Could you please tell me how to solve this problem?

  3. Thanks for instruction. But if you using JMX/JConsole to connect to the server – it wont work, becase file permition for
    -rwxrwxr-x- 1 alex alex 62 Jan 2 16:10 /usr/local/WowzaMediaServer/conf/jmxremote.access
    -rwxrwxr-x- 1 alex alex 49 Jan 2 16:10 /usr/local/WowzaMediaServer/conf/jmxremote.password

    Need to change as writed here –

    Should be
    alex@wowza:~$ ls -l /usr/local/WowzaMediaServer/conf/jmxremote.*
    -rw——- 1 alex alex 62 Jan 2 16:10 /usr/local/WowzaMediaServer/conf/jmxremote.access
    -rw——- 1 alex alex 49 Jan 2 16:10 /usr/local/WowzaMediaServer/conf/jmxremote.password


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>