-
Notifications
You must be signed in to change notification settings - Fork 16
/
install_nginx_pushstream_module.sh
32 lines (21 loc) · 1.2 KB
/
install_nginx_pushstream_module.sh
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
28
29
30
31
32
#!/usr/bin/env bash
#So download the Nginx source from the ppa repository:
cd /opt
sed -i "s/^\#deb\-src/deb\-src/" /etc/apt/sources.list.d/nginx-stable-trusty.list
apt-get -y update
apt-get -y build-dep nginx
apt-get -y source nginx
#Download one or more modules you want to compile in (we’ll use the push-stream module)
nginx_version=`nginx -v 2>&1 | awk '{print $3}' | cut -d '/' -f 2`
cd /opt/nginx-$nginx_version/debian/modules
git clone https://github.com/wandenberg/nginx-push-stream-module.git
wget http://wiki.nginx.org/images/5/51/Nginx-accesskey-2.0.3.tar.gz
tar xzvf Nginx-accesskey-2.0.3.tar.gz
sed -i 's/$HTTP_ACCESSKEY_MODULE/ngx_http_accesskey_module/' nginx-accesskey-2.0.3/config
#cp /home/vagrant/rules /opt/nginx-$nginx_version/debian/rules
sed -i 's/--add-module=$(MODULESDIR)\/ngx_http_substitutions_filter_module/--add-module=$(MODULESDIR)\/ngx_http_substitutions_filter_module --add-module=$(MODULESDIR)\/nginx-push-stream-module --add-module=$(MODULESDIR)\/nginx-accesskey-2.0.3/' /opt/nginx-$nginx_version/debian/rules
cd /opt/nginx-$nginx_version
dpkg-buildpackage -uc -b
apt-get remove -y nginx
dpkg --install /opt/nginx-full_$nginx_version-1+trusty1_amd64.deb
apt-mark hold nginx-full