Skip to content

Instantly share code, notes, and snippets.

@imerr
Last active December 8, 2016 03:49
Show Gist options
  • Save imerr/8884560 to your computer and use it in GitHub Desktop.
Save imerr/8884560 to your computer and use it in GitHub Desktop.
Simple (lazy) nginx-rtmp install script I use for setting up servers, it's obviously missing the configuration part
#!/bin/bash
set -e
apt-get update
apt-get -y upgrade
apt-get remove -y nginx-common nginx-full
rm -rf /usr/src/nginx* /usr/src/headers-more-nginx-module
# build dependencies
apt-get -y install dpkg-dev git autotools-dev debhelper po-debconf dh-systemd libexpat-dev libgd2-dev libgeoip-dev libluajit-5.1-dev libmhash-dev libpam0g-dev libpcre3-dev libperl-dev libssl-dev libxslt1-dev zlib1g-dev autotools-dev de$
cd /usr/src
apt-get -y source nginx
git clone https://github.com/arut/nginx-rtmp-module.git
cd /usr/src/nginx-1*/
awk '/common_configure_flags := \\/{print;print " --add-module=/usr/src/nginx-rtmp-module\\";next}1' debian/rules > debian/rules.tmp
rm debian/rules
mv debian/rules.tmp debian/rules
dpkg-buildpackage -b
cd ..
dpkg --install nginx-common_*.deb
dpkg --install nginx-full_*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment