導航:首頁 > 源碼編譯 > 重新編譯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為什麼收不到驗證碼 瀏覽:697
禮品發包網源碼 瀏覽:569
什麼app上能制圖 瀏覽:86
為什麼代理伺服器沒響應 瀏覽:562
小程序編譯提示 瀏覽:824
nameerrorpython 瀏覽:294
辭典pdf下載 瀏覽:801
遺傳演算法違反約束路徑數目 瀏覽:177
少年班中的古人演算法 瀏覽:931
什麼app一鍵p圖好看 瀏覽:573
查詢手機連上電腦的命令 瀏覽:850
javasftp實現 瀏覽:369
源碼升級的意思 瀏覽:399
緩解壓力手勢圖片下載 瀏覽:96
程序員抽煙找靈感 瀏覽:767
老火湯pdf 瀏覽:224
少有人走的路與心靈對話pdf 瀏覽:205
兩單片機串口通信 瀏覽:801
程序員過試用期 瀏覽:108
演算法信息量不可計算 瀏覽:954