Mac搭建nginx+rtmp伺服器
阿新 • • 發佈:2019-01-13
一、安裝Homebrew
執行命令:
1 2 3 | ruby-e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
如果已經安裝過,而想要解除安裝:
1 2 3 |
ruby-e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" |
如果已經安裝過,則不用安裝!
二、安裝nginx
先glone nginx專案到本地:
1 2 3 | brew tap homebrew/nginx |
執行安裝:
1 2 3 | brew install nginx-full--with-rtmp-module |
通過操作以上步驟,nginx和rtmp模組就安裝好了
三、執行nginx
執行命令:
1 2 3 | nginx |
出現如下頁面資訊,表示nginx伺服器搭建成功了,而且已經安裝了RTMP模組了:
四、配置nginx和rtmp
下面開始來配置nginx的rtmp模組。首先,我們要看看nginx安裝到哪裡了:
1 2 3 | brew info nginx-full |
出現如下類似資訊:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ==>Caveats Docrootis:/usr/local/var/www Thedefaultport has been set in/usr/local/etc/nginx/nginx.conf to8080so that nginx can run without sudo. nginx will load all files in/usr/local/etc/nginx/servers/. -Tips- Runport80: $sudo chownroot:wheel |