• How to run Wowza Media Server as Named User (Linux and OS X)


    Note: This article is for an older Wowza™ product or technology that either has been updated or is no longer supported. For the current version of this article, see How to run Wowza Streaming Engine as a Named User (Linux and OS X).
    On Linux and Mac OS operating systems, the default installation of Wowza Media Server™ 3.5.0 (or later) runs as the root user. If you want to run the server as a different user, use the following instructions to create a new user and configure the server to run as that new user.

    Note: For security reasons, most Linux and Unix distributions only allow the root user to bind to port numbers less than 1024. If you plan on running Wowza Media Server on a lower-numbered port such as 80 (HTTP), 443 (HTTPS, RTMPS), or 554 (RTSP), then the server must continue to run as the root user.

    Linux


    1. Create a new user and group named wowza.
      groupadd wowza
      useradd -g wowza wowza
      passwd wowza
    2. Change ownership and permissions on Wowza Media Server installation files. For example:
      cd /usr/local
      chown -h wowza:wowza WowzaMediaServer
      chown -R wowza:wowza WowzaMediaServer-3.5.0 
      chmod -R 775 WowzaMediaServer-3.5.0
      rm -f /var/run/WowzaMediaServer.pid
      rm -f /var/run/WowzaMediaServer.lock
    3. Change the command that's used to start the server so that it runs as the new wowza user.
      1. Change directory to the /usr/local/WowzaMediaServer/bin directory.
      2. Edit the standalone startup script startup.sh and prepend sudo -u wowza to the 24th line. It should now be:
        sudo -u wowza $_EXECJAVA $JAVA_OPTS $JMXOPTIONS -Dcom.wowza.wms.runmode="standalone" -Dcom.wowza.wms.native.base="linux" -Dcom.wowza.wms.AppHome="$WMSAPP_HOME" -Dcom.wowza.wms.ConfigURL="$WMSCONFIG_URL" -Dcom.wowza.wms.ConfigHome="$WMSCONFIG_HOME" -cp $WMSAPP_HOME/bin/wms-bootstrap.jar com.wowza.wms.bootstrap.Bootstrap start
    4. Edit the service startup script wms.sh and make the same change to line 24. Now both the standalone startup script and the service startup script will start the server as the user wowza.
    5. Start Wowza Media Server in standalone or service mode and verify that it's running as the user wowza by opening a terminal window and executing the command ps -ja to see the list of running processes.

    Note: you may need to edit /etc/sudoers to comment out the Defaults requiretty

    Mac OS X


    1. Create a new user named wowza.
      1. Open the Accounts systems preferences panel.
      2. Unlock the add user functionality by clicking on the lock icon in the lower-left corner of the panel (you'll be asked to enter your administrative password).
      3. Click the Plus (+) button below the list of users to add a new user.
      4. Enter the following values and then click the Create Account button:
        Name: wowza
        Short Name: wowza
        Password: [enter a password]
        Verify: [enter a password]
    2. Change the permissions on Wowza Media Server installation files. Open a terminal window and enter the following commands (be sure to specify the correct Wowza Media Server version):
      cd /Library 
      sudo chown wowza:admin WowzaMediaServer 
      sudo chown -R wowza:admin WowzaMediaServer-3.5.0
    3. Change the command that's used to start the server so that it runs as the new wowza user.
      1. Change directory to the /Library/WowzaMediaServer/bin directory.
      2. Edit the standalone startup script startup.sh and prepend sudo -u wowza to the 24th line. It should now be:
        sudo -u wowza $_EXECJAVA $JAVA_OPTS $JMXOPTIONS -Dcom.wowza.wms.runmode="standalone" -Dcom.wowza.wms.native.base="osx" -Dcom.wowza.wms.AppHome="$WMSAPP_HOME" -Dcom.wowza.wms.ConfigURL="$WMSCONFIG_URL" -Dcom.wowza.wms.ConfigHome="$WMSCONFIG_HOME" -cp $WMSAPP_HOME/bin/wms-bootstrap.jar com.wowza.wms.bootstrap.Bootstrap start
    4. Start Wowza Media Server in standalone or service mode and verify that it's running as the user wowza by opening a terminal window and executing the command ps -ja to see the list of running processes.