導航:首頁 > 源碼編譯 > 重新編譯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模塊相關的資料

熱點內容
比澤爾壓縮機代理商 瀏覽:629
什麼app能下載多鄰國 瀏覽:234
伺服器藍色什麼意思 瀏覽:226
vb組態軟體源碼 瀏覽:698
加密蚊帳防蚊門簾 瀏覽:828
vs2010多線程編程 瀏覽:214
新股上市指標源碼 瀏覽:699
c語言51單片機教程 瀏覽:554
app中的hd是什麼意思 瀏覽:279
手機什麼解壓器最好 瀏覽:49
什麼是適合自己的app 瀏覽:451
雲伺服器怎麼補漏洞 瀏覽:176
如何看自己的安卓是什麼等級 瀏覽:633
被丁磊挖走的程序員 瀏覽:19
gsk980ta編程 瀏覽:507
單片機離線 瀏覽:84
解壓助眠敲擊外國長指甲 瀏覽:421
3次元編程 瀏覽:803
夫妻傳送英文命令 瀏覽:316
程序員題代做 瀏覽:950