INSTALL THE NGINX RTMP MODULE

INSTALL THE NGINX RTMP MODULE

FIRST INSTALL THESE USEFUL / REQUIRED PACKAGES

sudo apt-get install wget unzip software-properties-common dpkg-dev git make gcc automake build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libxslt1-dev libxml2-dev libgd-dev libgeoip-dev libgoogle-perftools-dev libperl-dev pkg-config autotools-dev gpac ffmpeg mediainfo mencoder lame libvorbisenc2 libvorbisfile3 libx264-dev libvo-aacenc-dev libmp3lame-dev libopus-dev unzip

ADD THE NGINX REPOSITORY AND UPDATE

sudo add-apt-repository ppa:nginx/stable

sudo apt update

INSTALL NGINX

sudo apt install nginx

INSTALL THE RTMP MODULE

sudo apt install libnginx-mod-rtmp

CLONE THE RTMP GIT

cd /usr/src

git clone https://github.com/arut/nginx-rtmp-module

COPY THE STAT.XSL FILE TO YOUR WEB FOLDER

cp /usr/src/nginx-rtmp-module/stat.xsl /var/www/html/stat.xsl

CREATE A NEW FILE CALLED CROSSDOMAIN.XML IN YOUR WEB FOLDER

sudo nano /var/www/html/crossdomain.xml

PASTE THIS IN THE NEW FILE AND SAVE IT

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "https://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-access-from domain="*"/>

</cross-domain-policy>

EDIT THE NGINX CONDIF FILE

sudo nano /etc/nginx/nginx.conf

AT THE END OF THE FILE ADD THIS

rtmp {

    server {

      listen 1935;

      chunk_size 4096;


      application live {

live on;

      record off;

interleave off;

wait_key on;

meta on;

wait_video off;

idle_streams off;

sync 300ms;

session_relay on;

#allow publish 127.0.0.1;

#allow publish 192.168.2.0/24;

allow publish all;

#deny publish all;

allow play all;    

# EDIT THESE SO THE LIVESTREAM_KEY IS REPLACED BY YOUR PERSONAL KEY THAT YOU CAN LOOK UP ON THE SITE OF THE PLATFORM

# push rtmp://live-ams.twitch.tv/app/LIVESTREAM_KEY;

# push rtmp://a.rtmp.youtube.com/live2/LIVESTREAM_KEY;

# push rtmp://ingest-ams.mixer.com:1935/beam/LIVESTREAM_KEY;

}

    }

}

EDIT THE DEFAULT SITE CONFIG

sudo nano /etc/nginx/sites-enabled/default

SEARCH FOR THE FOLLOWING LINES:

#location ~ /\.ht {

# deny all;

AND DIRECTLY UNDER IT PASTE THE FOLLOWING

location /stat {

rtmp_stat all;

rtmp_stat_stylesheet stat.xsl;

}

location /stat.xsl {

root /var/www/html/;

}

#location /control {

# you'll need a htpasswd auth file, that's outside the scope of this doc but any apache one will work

# auth_basic "stream";

# rtmp_control all;

#}

SO THAT IT WILL LOOK SOMETHING LIKE THIS AFTER PASTING:

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

#location ~ /\.ht {

# deny all;

#}


location /stat {

rtmp_stat all;

rtmp_stat_stylesheet stat.xsl;

}

location /stat.xsl {

root /var/www/html/;

}

#location /control {

# you'll need a htpasswd auth file, that's outside the scope of this doc but any apache one will work

# auth_basic "stream";

# rtmp_control all;

#}

}

Virtual Host configuration for example.com

USE DIFFERENT VARIABLES TO FURTHER SET UP YOUR SERVER. https://github.com/arut/nginx-rtmp-module



要查看或添加评论,请登录

Karim C.的更多文章

  • Mail Server Setup Service

    Mail Server Setup Service

    Get Your Mailcow Installation Support Telegram: https://t.me/LinuxGun Email: linuxguns@gmail.

  • Bagisto Installation & Configuration Support Starts Here

    Bagisto Installation & Configuration Support Starts Here

    ?? Get Bagisto eCommerce Platform Setup Telegram: https://t.me/LinuxGun ?? Email: linuxguns@gmail.

  • TRYTON Business Software Setup Starts Here

    TRYTON Business Software Setup Starts Here

    Are you looking to streamline your business operations, enhance productivity, and gain better control over your…

  • cope with W: Failed to fetch

    cope with W: Failed to fetch

    This article will show how to deal with Failed to fetch warning into Ubuntu Linux Simple workground $ echo "nameserver…

  • ?????????????

    ?????????????

    ???????? ??????? ???????? ??????? ??? ????????? ????????????? ???? ??????? ?????? ??????- ????? ????? ????????? ??????,…

  • Node.js v10.x Install Ubuntu Linux

    Node.js v10.x Install Ubuntu Linux

    #!/bin/sh curl -sL https://deb.nodesource.

  • Docker

    Docker

    docker Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string Location of…

  • Nexus (nxs) Coin Ubuntu 18.04 Wallet Compiling Instructions Article

    Nexus (nxs) Coin Ubuntu 18.04 Wallet Compiling Instructions Article

    NOTE: This article assumes you're using a fresh install of Ubuntu 18.04.

  • Installing an FTP server (vsftpd) on Ubuntu 18.04

    Installing an FTP server (vsftpd) on Ubuntu 18.04

    sudo apt update && sudo apt install vsftpd sudo service vsftpd status sudo ufw allow OpenSSH sudo ufw allow 20/tcp sudo…

  • Install MongoDB in Ubuntu 18.04 LTS

    Install MongoDB in Ubuntu 18.04 LTS

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.

社区洞察

其他会员也浏览了