27 樹莓派做直播平台


http://www.52pi.net/archives/981

 

用樹莓派做 RTMP 流直播服務器,可推送至斗魚直播

 http://shumeipai.nxez.com/2017/11/01/build-rtmp-stream-live-server-with-raspberry-pi.html

 

用樹莓派DIY共享魚缸,支持微信遠程喂魚

http://shumeipai.nxez.com/2017/09/27/nature-aquarium-for-sharing.html

 

阿里雲服務器+樹莓派+mjpeg-streamer實現外網視頻監控

https://blog.csdn.net/little_bobo/article/details/78810137

 

實驗平台
阿里雲服務器 debain系統
樹莓派3

一.樹莓派安裝mjpeg-streamer
見樹莓派安裝mjpeg-streamer

二.阿里雲服務器安裝配置Apache2

安裝Apache2
apt-get install apache2
加載模塊
a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http
編輯proxy配置文件
nano /etc/apache2/mods-enabled/proxy.conf
我配置后的文件如下


我開啟的是服務器的10005端口,阿里雲服務器的外部訪問端口要自己開啟

 

重新啟動apache2
service apache2 restart

三.樹莓派通過ssh反向隧道將mjpeg-streamer的8080端口代理到公網VPS
ssh -fN -R 10005:localhost:8080 自己的阿里雲服務器用戶名@服務器IP
例如 ssh -fN -R 10005:localhost:8080 root@120.78.152.5
隨后要輸入服務器的登錄密碼

開啟樹莓派 mjpeg-streamer服務
開啟方法見樹莓派安裝mjpeg-streamer

谷歌瀏覽器輸入http://你的服務器ip/proxy/?action=stream
隨后可以看到圖像
————————————————

 

利用nginx實現反向代理

https://qiushangzhe.github.io/pi/2018/01/02/pi-nginx-proxy.html

 

 

 

 

nginx反向代理配置(多用於一個外網端口,多個內網服務端口)

首先我在本地用koa開啟了兩個http服務。 端口分別是3000和3001 返回的是當前訪問的url和服務的端口號

截圖 截圖

 

然后nginx的配置文件

server {
  listen 80;
  location /service1/ {
    proxy_pass http://127.0.0.1:3000/;
  }

  location /service2/ {
    proxy_pass http://127.0.0.1:3001/;
  }
}

  

最后重啟nginx

截圖 截圖

nginx配置(一個外網端口,多個靜態網站)

  • 為了方便測試,我在本地創建了兩個文件夾,作為兩個網站的根目錄。

截圖

開始配置nginx:

server {
  listen 80;
  location ^~ /service1/ {
    alias /Users/qiusz/qiushangzhe/mycode/testcode/web01/;
    index index.html;
  }

  location ^~ /service2/ {
    alias /Users/qiusz/qiushangzhe/mycode/testcode/web02/;
    index index.html;
  }
}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM