㈠ 問下像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)問題依舊可以嘗試:
移除舊安裝目錄下文件(rm -rf /usr/local/nginx)
清楚編譯產生的文件(make clean)
使用正確的選項重新編譯安裝
問題還在?嘗試換個 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模塊。