@@ -61,7 +61,8 @@ Here's some guides on installing/using:
61
61
* [ Requirements] ( #requirements )
62
62
* [ Installation] ( #installation )
63
63
+ [ Install with Docker] ( #install-with-docker )
64
- + [ Install OpenResty with RTMP] ( #install-openresty-with-rtmp )
64
+ + [ Install OpenResty with ` setup-openresty ` ] ( #install-openresty-with-setup-openresty )
65
+ + [ Alternative: Install OpenResty with RTMP Manually] (#alternative-install-openresty-with-rtmp manually)
65
66
+ [ Alternative: Install nginx with Lua and rtmp] ( #alternative-install-nginx-with-lua-and-rtmp )
66
67
+ [ Setup database and user in Postgres] ( #setup-database-and-user-in-postgres )
67
68
+ [ Setup Redis] ( #setup-redis )
@@ -106,68 +107,79 @@ I have a Docker image available, along with a docker-compose file for
106
107
quickly getting up and running. Instructions are available here:
107
108
https://github.com/jprjr/docker-multistreamer
108
109
109
- ### Install OpenResty with RTMP
110
+ ### Install OpenResty with ` setup-openresty `
111
+
112
+ I've written a script for setting up OpenResty and LuaRocks: https://github.com/jprjr/setup-openresty
113
+
114
+ This is now my preferred way for setting up OpenResty. It automatically
115
+ installs build pre-requisites for a good number of distros, and installs
116
+ Lua 5.1.5 in addition to LuaJIT. This allows LuaRocks to build C modules
117
+ that no longer build against LuaJIT (like cjson).
118
+
119
+ To install, simply:
120
+
121
+ ``` bash
122
+ git clone https://github.com/jprjr/setup-openresty
123
+ cd setup-openresty
124
+ sudo ./setup-openresty
125
+ --prefix=/opt/openresty-rtmp \
126
+ --with-rtmp \
127
+ --with-stream \
128
+ --with-stream-lua
129
+ ```
130
+
131
+ ### Alternative: Install OpenResty with RTMP Manually
110
132
111
133
You don't explicitly need OpenResty - it's just convenient because it already
112
134
includes the Lua module (and the Lua module's requirements).
113
135
136
+ You'll want to install Lua 5.1.5 as well, so that LuaRocks can build older
137
+ C modules. Included inline is a patch for building liblua as a dynamic library.
138
+
114
139
``` bash
115
- sudo apt-get install libreadline-dev libncurses5-dev libpcre3-dev \
116
- libssl-dev perl make build-essential unzip curl git
140
+ sudo apt-get -y install \
141
+ libreadline-dev \
142
+ libncurses5-dev \
143
+ libpcre3-dev \
144
+ libssl-dev \
145
+ perl \
146
+ make \
147
+ build-essential \
148
+ unzip \
149
+ curl \
150
+ git
117
151
mkdir openresty-build && cd openresty-build
118
- curl -R -L https://openresty.org/download/openresty-1.11.2.2 .tar.gz | tar xz
119
- curl -R -L https://github.com/arut/nginx-rtmp-module/archive/v1.1.10 .tar.gz | tar xz
120
- curl -R -L https://github.com/openresty/stream-lua-nginx-module/archive/e527417c5d04da0c26c12cf4d8a0ef0f1e36e051 .tar.gz | tar xz
152
+ curl -R -L https://openresty.org/download/openresty-1.11.2.5 .tar.gz | tar xz
153
+ curl -R -L https://github.com/arut/nginx-rtmp-module/archive/v1.2.0 .tar.gz | tar xz
154
+ curl -R -L https://github.com/openresty/stream-lua-nginx-module/archive/a3a050bfacfb8d097ee276380c4e606031f2aaf2 .tar.gz | tar xz
121
155
curl -R -L http://luarocks.github.io/luarocks/releases/luarocks-2.4.2.tar.gz | tar xz
122
- cd openresty-1.11.2.2
156
+ curl -R -L https://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
157
+
158
+ cd openresty-1.11.2.5
123
159
./configure \
124
160
--prefix=/opt/openresty-rtmp \
125
161
--with-pcre-jit \
126
162
--with-ipv6 \
127
163
--with-stream \
128
164
--with-stream_ssl_module \
129
- --add-module=../nginx-rtmp-module-1.1.10 \
130
- --add-module=../stream-lua-nginx-module-e527417c5d04da0c26c12cf4d8a0ef0f1e36e051
165
+ --add-module=../nginx-rtmp-module-1.2.0 \
166
+ --add-module=../stream-lua-nginx-module-a3a050bfacfb8d097ee276380c4e606031f2aaf2
131
167
make
132
168
sudo make install
169
+
170
+ cd ../lua-5.1.5
171
+ patch -p1 < /path/to/lua-5.1.5.patch # in this repo under misc
172
+ sed -e ' s,/usr/local,/opt/openresty-rtmp,g' -i src/luaconf.h
173
+ make CFLAGS=" -fPIC -O2 -Wall -DLUA_USE_LINUX" linux
174
+ sudo make INSTALL_TOP=" /opt/openresty-rtmp/luajit" TO_LIB=" liblua.a liblua.so" install
175
+
133
176
cd ../luarocks-2.4.2
134
177
./configure \
135
178
--prefix=/opt/openresty-rtmp \
136
179
--with-lua=/opt/openresty-rtmp/luajit \
137
- --lua-suffix=jit \
138
- --with-lua-include=/opt/openresty-rtmp/luajit/include/luajit-2.1
139
- ```
140
-
141
- ### Alternative: Install nginx with Lua and rtmp
142
-
143
- Here's a short script to download nginx and install it to ` /opt/nginx-rtmp `
144
-
145
- ``` bash
146
- mkdir nginx-build && cd nginx-build
147
- curl -R -L http://nginx.org/download/nginx-1.10.2.tar.gz | tar xz
148
- curl -R -L https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz | tar xz
149
- curl -R -L https://github.com/openresty/lua-nginx-module/archive/v0.10.7.tar.gz | tar xz
150
- curl -R -L https://github.com/arut/nginx-rtmp-module/archive/v1.1.10.tar.gz | tar xz
151
- curl -R -L https://github.com/openresty/stream-lua-nginx-module/archive/e527417c5d04da0c26c12cf4d8a0ef0f1e36e051.tar.gz | tar xz
152
- cd nginx-1.10.2
153
- export LUAJIT_LIB=$( pkg-config --variable=libdir luajit)
154
- export LUAJIT_INC=$( pkg-config --variable=includedir luajit)
155
- ./configure \
156
- --prefix=/opt/nginx-rtmp \
157
- --with-threads \
158
- --with-file-aio \
159
- --with-ipv6 \
160
- --with-http_ssl_module \
161
- --with-pcre \
162
- --with-pcre-jit \
163
- --with-stream \
164
- --with-stream_ssl_module \
165
- --add-module=../ngx_devel_kit-0.3.0 \
166
- --add-module=../lua-nginx-module-0.10.7 \
167
- --add-module=../nginx-rtmp-module-1.1.10 \
168
- --add-module=../stream-lua-nginx-module-e527417c5d04da0c26c12cf4d8a0ef0f1e36e051
169
- make
170
- sudo make install
180
+ --rocks-tree=/opt/openresty-rtmp/luajit
181
+ make build
182
+ sudo make bootstrap
171
183
```
172
184
173
185
### Setup database and user in Postgres
0 commit comments