導航:首頁 > 源碼編譯 > 重新編譯nginx增加rtmp模塊

重新編譯nginx增加rtmp模塊

發布時間:2023-08-09 14:55:41

㈠ 問下像YY直播那樣給的RTMP推流地址建的是什麼伺服器 怎樣搭建這樣的伺服器

可以使用nginx的rtmp模塊來搭建。可以在github上下載,進入nginx目錄,執行命令./configure --prefix=./bin --add-mole=../nginx-rtmp-mole-1.2.1在這個過程中可能因為環境不同而出現不同錯誤,比如缺少pcre、openssl等,這時候就需要安裝這些庫。

nginx.conf配置文件信息

userroot;
worker_processes1;

error_loglogs/error.logdebug;

events{
worker_connections1024;
}

rtmp{
server{
listen1935;
applicationmyapp{
liveon;
drop_idle_publisher5s;
}
}
}
http{
server{
listen8081;
location/stat{
rtmp_statall;
rtmp_stat_stylesheetstat.xsl;
}
location/stat.xsl{
root/root/nginx-rtmp-mole-1.2.1/;
}
location/control{
rtmp_controlall;
}
location/rtmp-publisher{
root/root/nginx-rtmp-mole-1.2.1/test;
}

location/{
root/root/nginx-rtmp-mole-1.2.1/test/www;
}
}
}

全部完成之後 重新啟動nginx

㈡ 在nginx.conf中加入rtmp後nginx啟動不了

1)正確編譯和安裝:網頁鏈接

2)安裝完成後,鍵入 nginx -V 命令查看(無法找到命令的話,請使用絕對路徑訪問 nginx 可執行文件)

正常編譯安裝情況

應當出現類似 --add-mole=nginx-rtmp-mole 字樣

3)問題依舊可以嘗試:

  1. 移除舊安裝目錄下文件(rm -rf /usr/local/nginx)

  2. 清楚編譯產生的文件(make clean)

  3. 使用正確的選項重新編譯安裝

  4. 問題還在?嘗試換個 nginx 版本,再重復上述步驟

㈢ Ubuntu下Nginx 安裝rtmp模塊失敗

安裝已經結束,下面來看配置。
在nginx安裝目錄下先復制一份默認的配置文件出來:
cd /usr/local/nginx/conf
cp nginx.conf live_rtmp.conf12

編輯live_rtmp.conf如下:
#user nobody;
worker_processes 1;

error_log logs/error.log;

㈣ window版本的nginx能重新編譯嗎如何添加新的模塊呢

找到安裝nginx的源碼根目錄,如果沒有的話下載新的源碼
http://nginx.org
tar xvzf nginx-1.3.2.tar.gz
查看ngixn版本極其編譯參數
/usr/local/nginx/sbin/nginx -V
進入nginx源碼目錄
cd nginx-1.3.2
以下是重新編譯的代碼和模塊
./configure --prefix=/usr/local/nginx--with-http_stub_status_mole
--with-http_ssl_mole --with-file-aio --with-http_realip_mole
make 千萬別make install,否則就覆蓋安裝了
make完之後在objs目錄下就多了個nginx,這個就是新版本的程序了
備份舊的nginx程序
cp /usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
把新的nginx程序覆蓋舊的
cp objs/nginx /usr/local/nginx/sbin/nginx
測試新的nginx程序是否正確
/usr/local/nginx/sbin/nginx -t
nginx: theconfiguration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx:configuration file /usr/local/nginx/conf/nginx.conf test issuccessful
平滑重啟nginx
/usr/local/nginx/sbin/nginx -s reload
查看ngixn版本極其編譯參數
/usr/local/nginx/sbin/nginx -V
這是我重新編譯的代碼:
./configure --prefix=/usr/local/nginx --with-google_perftools_mole
--user=www --group=www --with-http_stub_status_mole
--with-http_gzip_static_mole --with-openssl=/usr/
--with-pcre=/mydata/soft/pcre-8.31

㈤ nginx怎麼搭建非本地rtmp伺服器

1、電源一定要看清楚是不是正負極接線反向了;
2、如果模擬的時候,其它的東西都按照書本的要求填了,還是提示下面這個初始化錯誤,那就是沒有加powergui模塊。

閱讀全文

與重新編譯nginx增加rtmp模塊相關的資料

熱點內容
用什麼app可以找校友 瀏覽:100
雲伺服器刪除實例再創建要付錢嗎 瀏覽:347
wifi的加密類型從哪裡看 瀏覽:627
為什麼手機有的app顯示沒網 瀏覽:44
黑馬程序員入學知識 瀏覽:795
計算機編譯器使用 瀏覽:35
為什麼花雨庭伺服器會閃退 瀏覽:5
cad的xc命令 瀏覽:898
程序員初級和大佬的區別 瀏覽:546
安卓機怎麼進入調試狀態 瀏覽:176
壓縮機運行與維修實用技術 瀏覽:727
編譯原理程序語言 瀏覽:319
安慶緩解壓力頭部按摩儀用途 瀏覽:576
帶括弧的除法演算法 瀏覽:488
pdf登陸 瀏覽:831
微雲的文件夾怎麼下載到手機 瀏覽:291
大廠高薪招聘程序員 瀏覽:12
看長篇小說用什麼app 瀏覽:955
部路沖突安卓怎麼轉到ios 瀏覽:629
騰訊微雲解壓用vip嗎 瀏覽:259