寶塔nginx安裝rtmp模組實現推拉流

2022-09-14 13:12:09 字數 2047 閱讀 7973

//拉取nginx-rtmp-module待編譯檔案

cd /www/server/panel/install

//進入安裝配置檔案路徑

cp nginx.sh nginxcopy.sh

//複製乙份安裝shell指令碼 所有的修改在複製的指令碼上進行

vi nginxcopy.sh

//開始修改

/configure //

找到nginx編譯配置檔案

--add-module=/www/server/nginx_rtmp_module //

增加乙個模組配置

:wq //

儲存推出

sh nginxcopy.sh

install

1.12

//編譯安裝

nginx -v //

安裝完成後 檢視配置資訊

安裝成功後,配置rtmp來實現推拉流

//

配置檔案所在目錄

cd /www/server/nginx/conf

//修改nginx.conf檔案

user www www;

worker_processes auto;

error_log /www/wwwlogs/nginx_error.log crit;

pid /www/server/nginx/logs/nginx.pid;

worker_rlimit_nofile

51200

;events

include rtmp.conf;

//新增

}//其中rtmp.conf位於/www/server/nginx/conf目錄下,配置內容為

rtmp_auto_push on;

rtmp

live on;}}

}//然後在http訪問配置中增加

location /hls

root /www/tmp;

add_header cache-control no-cache;

}

配置完成後,

例子:

doctype html

>

<

html

lang

="en"

>

<

head

>

<

meta

charset

="utf-8"

>

<

title

>直播

title

>

<

script

src=""

charset

="utf-8"

>

script

>

head

>

<

body

>

<

div

id="id_test_video"

style

="width:100%; height:auto;"

>

div>

body

>

<

script

>

varplayer

=new

tcplayer(

'id_test_video

', );

script

>

html

>

Nginx安裝,配置RTMP模組

nginx engine x 是乙個高效能的http和反向 web伺服器,同時也提供了imap pop3 smtp服務。nginx是由伊戈爾 賽索耶夫為俄羅斯訪問量第二的rambler.ru站點 俄文 開發的。nginx是一款輕量級的web 伺服器 反向 伺服器及電子郵件 imap pop3 伺服器...

Nginx 安裝模組

nginx v 可以檢視已安裝模組 1 安裝自帶模組 重新編譯 指定模組 1 configure prefix 路徑 with 模組名 2 make 切記不要執行make install 不然會覆蓋之前配置 3 然後將原有二進位制nginx命令備份,同時將.objs nginx copy到安裝目錄下...

nginx安裝模組

已經安裝過nginx 在原來的nginx原始碼目錄中 不要make install 編譯好的在objs目錄下 備份原來的nginx sbin目錄下的檔案 複製objs目錄下的nginx到 usr local nginx sbin目錄下 upstream somestream其它配置 該模組可以根據配...