Skip to main content

Related to Nginx

How to install Nginx RTMP module?

Here is an example

  1. Get dependence

    sudo apt-get update
    sudo apt-get install dpkg-dev git
    sudo apt-get build-dep nginx-extras
  2. Get source

    sudo git clone
    sudo apt-get source nginx

    Check if nginx-1.10.3 folder exists. When isn't, execute the command again.

    sudo apt-get source nginx
  3. Modify configuration file (you can edit the rule with any text editor you like)

    cd nginx-1.10.3
    sudo vi debian/rules

    Add this flag to the extras_configure_flags, just after --with-stream_ssl_module

    --add-module=/usr/src/nginx-rtmp-module \
  4. Build the package

     sudo dpkg-buildpackage -b -uc -us
  5. Install new package

    cd ..
    sudo apt install ./nginx-common_1.10.3-1+deb9u3_all.deb
    sudo apt install ./nginx-extras_1.10.3-1+deb9u3_amd64.deb

The module needs to be compiled each time after upgrade the Nginx package. So, you can hold your own Nginx package to prevent accidental automatic upgrades

sudo apt-mark hold nginx
sudo apt-mark hold nginx-extras