Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt update
- sudo apt upgrade
- sudo su
- passwd
- [enter new password twice]
- sudo hostnamectl set-hostname YOUR.DOMAIN.COM
- 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
- apt install nginx -y
- apt install libnginx-mod-rtmp -y
- apt install php7.3 php7.3-common php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php-memcache php-imagick php-gettext php7.3-zip php7.3-mbstring php-pear mcrypt imagemagick libruby memcached
- sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php/7.3/fpm/php.ini
- sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 1024M/g' /etc/php/7.3/fpm/php.ini
- sed -i 's/max_input_time = 60/max_input_time = 300/g' /etc/php/7.3/fpm/php.ini
- sed -i 's/max_execution_time = 30/max_execution_time = 60/g' /etc/php/7.3/fpm/php.ini
- sed -i 's/;date.timezone =/date.timezone = "Europe\/Amsterdam"/g' /etc/php/7.3/fpm/php.ini
- systemctl restart php7.3-fpm
- apt install mariadb-server mariadb-client phpmyadmin
- mysql_secure_installation
- systemctl restart mysql
- mysql -u root -p
- [enter the password you set earlier]
- CREATE DATABASE wordpress;
- grant all privileges on wordpress.* TO 'wordpress'@'localhost' identified by 'YourPassword';
- FLUSH PRIVILEGES;
- systemctl restart mysql
- mkdir -p /var/www/yourhostname
- ln -s /usr/share/phpmyadmin /var/www/yourhostname/phpmyadmin
- chown -R www-data: /var/www/yourhostname
- cd /usr/src
- git clone https://github.com/arut/nginx-rtmp-module
- cp /usr/src/nginx-rtmp-module/stat.xsl /var/www/yourhostname/stat.xsl
- cp /usr/src/nginx-rtmp-module/stat.xsl /var/www/html/stat.xsl
- nano /var/www/html/crossdomain.xml
- <?xml version="1.0"?>
- <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
- <cross-domain-policy>
- <allow-access-from domain="*"/>
- </cross-domain-policy>
- cp /var/www/html/crossdomain.xml /var/www/yourhostname/crossdomain.xml
- nano /var/www/yourhostname/phpinfo.php
- <?php phpinfo(); ?>
- chown -R www-data:www-data /var/www/yourhostname
- chown -R www-data:www-data /var/www/html
- nano /etc/nginx/nginx.conf
- --------------------------------
- user www-data;
- worker_processes 1;
- pid /run/nginx.pid;
- include /etc/nginx/modules-enabled/*.conf;
- events {
- worker_connections 768;
- # multi_accept on;
- }
- http {
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- keepalive_timeout 65;
- types_hash_max_size 2048;
- # server_tokens off;
- # server_names_hash_bucket_size 64;
- # server_name_in_redirect off;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- gzip off;
- # gzip_vary on;
- # gzip_proxied any;
- # gzip_comp_level 6;
- # gzip_buffers 16 8k;
- # gzip_http_version 1.1;
- # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log;
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
- rtmp {
- access_log /var/log/nginx/rtmp_access.log;
- server {
- listen 1935;
- chunk_size 8192;
- application live {
- live on;
- meta on;
- record off;
- interleave off;
- wait_key on;
- wait_video off;
- idle_streams off;
- sync 300ms;
- session_relay on;
- max_connections 1000;
- allow publish all;
- allow play all;
- hls off;
- dash off;
- # on_publish http://yourdomain.com/plugin/Live/on_publish.php;
- # on_play http://yourdomain/plugin/Live/on_play.php;
- # on_record_done http://yourdomain/plugin/Live/on_record_done.php;
- push rtmp://localhost/hls;
- push rtmp://localhost/dash;
- }
- application hls {
- live on;
- record off;
- meta copy;
- allow publish 127.0.0.1;
- allow play all;
- hls on;
- hls_nested on;
- hls_cleanup on;
- hls_sync 100ms;
- hls_fragment 2s;
- hls_playlist_length 10s;
- hls_path /var/livestream/hls;
- }
- application dash {
- live on;
- record off;
- allow publish 127.0.0.1;
- deny publish all;
- allow play all;
- dash on;
- dash_nested on;
- dash_cleanup on;
- dash_fragment 5s;
- dash_playlist_length 20s;
- dash_path /var/livestream/dash;
- }
- application vods {
- play /var/livestream/recordings;
- allow play all;
- }
- application vods_http {
- play https://yourdomain.com/recordings;
- allow play all;
- }
- }
- }
- --------------------------------
- mkdir /var/log/nginx
- mkdir -p /var/livestream/hls
- mkdir -p /var/livestream/dash
- mkdir -p /var/livestream/recordings
- chown -R www-data:www-data /var/log/nginx
- chown -R www-data:www-data /var/livestream
- nano /etc/nginx/sites-available/yourhostname.conf
- ---------------------------------
- server {
- listen 80;
- listen [::]:80;
- server_name yourhostname;
- root /var/www/yourhostname;
- index index.php index.html index-nginx.html index.htm;
- add_header Strict-Transport-Security "max-age=63072000;";
- add_header X-Frame-Options "DENY";
- location / {
- add_header Cache-Control no-cache;
- }
- add_header Access-Control-Allow-Origin *;
- try_files $uri $uri/ =404;
- }
- location ~ \.php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
- # fastcgi_pass 127.0.0.1:9000;
- }
- location /stat {
- rtmp_stat all;
- rtmp_stat_stylesheet stat.xsl;
- #auth_basic Restricted Content;
- #auth_basic_user_file .htpasswd;
- }
- location /stat.xsl {
- root html;
- }
- location /control {
- rtmp_control all;
- #auth_basic stream;
- #auth_basic_user_file .htpasswd;
- }
- location ~ /\.ht {
- deny all;
- }
- location /hls {
- types {
- application/vnd.apple.mpegurl m3u8;
- video/mp2t ts;
- }
- autoindex on;
- alias /var/livestream/hls;
- expires -1;
- add_header Strict-Transport-Security "max-age=63072000";
- add_header Cache-Control no-cache;
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length';
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain charset=UTF-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- }
- location /dash {
- types{
- application/dash+xml mpd;
- video/mp4 mp4;
- }
- autoindex on;
- alias /var/livestream/dash;
- add_header Strict-Transport-Security "max-age=63072000";
- add_header Cache-Control no-cache;
- expires -1;
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Expose-Headers' 'Content-Length';
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain charset=UTF-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- }
- }
- ---------------------------------
- ln -s /etc/nginx/sites-available/yourhostname.conf /etc/nginx/sites-enabled/
- nginx -t
- systemctl restart nginx
- apt install python-certbot-nginx
- certbot --nginx -d yourhostname
- nginx -t
- systemctl restart nginx
- nano /etc/nginx/sites-available/yourhostname.conf
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- ssl_certificate /etc/letsencrypt/live/yourhostname/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/yourhostname/privkey.pem;
- include /etc/letsencrypt/options-ssl-nginx.conf;
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
- ssl_trusted_certificate /etc/letsencrypt/live/yourhostname/chain.pem;
- nano /etc/letsencrypt/options-ssl-nginx.conf
- ---------------------------------
- ssl_session_cache shared:le_nginx_SSL:1m;
- ssl_session_timeout 1d;
- ssl_session_tickets off;
- ssl_protocols TLSv1.2;
- ssl_prefer_server_ciphers on;
- ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
- ssl_ecdh_curve secp384r1;
- ssl_stapling on;
- ssl_stapling_verify on;
- add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload;";
- add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin";
- add_header X-Frame-Options SAMEORIGIN;
- add_header X-Content-Type-Options nosniff;
- add_header X-XSS-Protection "1; mode=block";
- ----------------------------------
- https://github.com/videojs/video.js/releases
- https://github.com/videojs/http-streaming/releases
- nano /var/www/yourhostname/livestreamhls.html
- --------------------------------------
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset=utf-8 />
- <title>LiveStream</title>
- <!--
- Uses the latest versions of video.js and videojs-http-streaming.
- To use specific versions, please change the URLs to the form:
- <link href="https://unpkg.com/[email protected]/dist/video-js.css" rel="stylesheet">
- <script src="https://unpkg.com/[email protected]/dist/video.js"></script>
- <script src="https://unpkg.com/@videojs/[email protected]/dist/videojs-http-streaming.js"></script>
- -->
- <link href="https://yourhostname/videojs/video-js.css" rel="stylesheet">
- </head>
- <body>
- <center>
- <video-js id="live_stream" class="vjs-default-skin" controls preload="auto" width="auto" height="auto">
- <source src="https://yourhostname/hls/stream/index.m3u8" type="application/x-mpegURL">
- </video-js>
- <script src='https://yourhostname/videojs/video.js'></script>
- <script src="https://yourhostname/videojs/videojs-http-streaming.js"></script>
- <script>
- var player = videojs('live_stream');
- </script>
- </center>
- </body>
- </html>
- --------------------------------------
- cd /var/www/yourhostname
- wget https://wordpress.org/latest.tar.gz
- chown -R www-data:www-data /var/www/yourhostname
- [videojs_hls url="https://yourhostname/hls/stream/index.m3u8" width="1280" inline="true" autoplay="true"]
- <!-- wp:paragraph -->
- <p>Here are all the links in random order that helped me set up this guide.</p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://github.com/videojs/video.js/releases/tag/v7.8.3https://github.com/videojs/http-streaming/releases">https://github.com/videojs/video.js/releases/tag/v7.8.3https://github.com/videojs/http-streaming/releases</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/videojs-contrib-dash">https://www.npmjs.com/package/videojs-contrib-dash</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/videojs-playlist-ui">https://www.npmjs.com/package/videojs-playlist-ui</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/videojs-seek-buttons">https://www.npmjs.com/package/videojs-seek-buttons</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/videojs-logo">https://www.npmjs.com/package/videojs-logo</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/@leochen1216/videojs-chromecast">https://www.npmjs.com/package/@leochen1216/videojs-chromecast</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://www.npmjs.com/package/videojs-playlist">https://www.npmjs.com/package/videojs-playlist</a></p>
- <!-- /wp:paragraph -->
- <!-- wp:paragraph -->
- <p><a href="https://videojs.com/plugins">https://videojs.com/plugins</a></p>
- <!-- /wp:paragraph -->
Add Comment
Please, Sign In to add comment