August 2, 2015

Compile nginx with RTMP support on Raspbian

Here’s a bash script. Put this into a new file, ~/

sudo apt-get update
sudo apt-get install nginx -y
sudo apt-get remove nginx -y
sudo apt-get clean nginx -y
sudo apt-get install -y curl build-essential libpcre3-dev libpcre++-dev zlib1g-dev libcurl4-openssl-dev libssl-dev
mkdir nginx-build
cd nginx-build
tar -zxvf nginx-1.7.5.tar.gz
cd nginx-1.7.5
./configure --prefix=/var/www --sbin-path=/usr/sbin/nginx  --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/ --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --without-http_proxy_module --add-module=/home/pi/nginx-build/nginx-rtmp-module-master

sudo make install
echo "made it to the end"

execute it like this:


Notice it installs nginx from the package manager, and then removes it. This will leave some useful files behind for running nginx as a service.

This script is made of commands I learned from these posts, which explain what’s going on line-by-line.