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;
  }
}

  

转载于:https://www.cnblogs.com/kekeoutlook/p/11380234.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值