-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
72 lines (67 loc) · 3.67 KB
/
install.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
#sudo add-apt-repository ppa:mc3man/trusty-media -y
sudo apt-get update -y
sudo apt-get install livestreamer build-essential libpcre3 libpcre3-dev libssl-dev git software-properties-common php-fpm php-mysql libsybdb5 php-gettext libgd-dev libgeoip-dev libxslt-dev zlibc zlib1g zlib1g-dev build-essential linux-kernel-headers -y
sudo apt-get install ffmpeg -y
sudo apt-get install stunnel4 -y
mkdir ~/working
mkdir ~/working/Tiyan
mkdir ~/working/nginx-rtmp-module
mkdir ~/working/ngx_devel_kit
mkdir ~/working/set-misc-nginx-module
mkdir ~/working/nginx
mkdir ~/working/nginx-hmac-secure-link
mkdir ~/working/nginx-vod-module
git clone https://github.com/NabiNeamati/Tiyan-Media-Server.git ~/working/Tiyan
git clone https://github.com/sergey-dryabzhinsky/nginx-rtmp-module.git ~/working/nginx-rtmp-module
git clone https://github.com/openresty/set-misc-nginx-module.git ~/working/set-misc-nginx-module
git clone https://github.com/simpl/ngx_devel_kit.git ~/working/ngx_devel_kit
git clone https://github.com/nginx-modules/nginx-hmac-secure-link.git ~/working/nginx-hmac-secure-link
git clone https://github.com/kaltura/nginx-vod-module.git ~/working/nginx-vod-module
wget http://nginx.org/download/nginx-1.16.1.tar.gz -P ~/working
tar -xf ~/working/nginx-1.16.1.tar.gz -C ~/working/nginx --strip-components=1
rm ~/working/nginx-1.16.1.tar.gz
cd ~/working/nginx
#./configure --with-http_ssl_module --add-module=../nginx-rtmp-module --add-module=../ngx_devel_kit --add-module=../set-misc-nginx-module --add-module=../nginx-hmac-secure-link
./configure --with-http_ssl_module --with-http_secure_link_module --add-module=../nginx-rtmp-module --add-module=../ngx_devel_kit --add-module=../set-misc-nginx-module --add-module=../nginx-vod-module --with-file-aio --with-threads --with-debug --with-cc-opt="-Wimplicit-fallthrough=0"
make -j 2
sudo make install
cp ~/working/Tiyan/conf/nginx.conf /usr/local/nginx/conf/nginx.conf
cp ~/working/Tiyan/conf/mime.types /usr/local/nginx/conf/mime.types
mkdir /usr/local/nginx/conf/vod
cp ~/working/Tiyan/conf/vod/vod.conf /usr/local/nginx/conf/vod/vod.conf
cp ~/working/Tiyan/conf/vod/vod.mime.types /usr/local/nginx/conf/vod/vod.mime.types
cp ~/working/Tiyan/conf/nginx.service /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
ufw allow 8080
ufw allow 80
ufw allow 1935
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 1935 -j ACCEPT
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
#rm /usr/local/nginx/html/*
cp ~/working/Tiyan/www/crossdomain.xml /usr/local/nginx/html/crossdomain.xml
#cp ~/working/Tiyan/www/index.php /usr/local/nginx/html/index.php
#cp ~/working/Tiyan/www/ielko-media-server.css /usr/local/nginx/html/ielko-media-server.css
#cp ~/working/Tiyan/www/stream.xml /usr/local/nginx/html/stream.xml
#cp ~/working/Tiyan/www/testing.png /usr/local/nginx/html/testing.png
#cp ~/working/Tiyan/www/favicon.ico /usr/local/nginx/html/favicon.ico
#git clone https://github.com/upggr/ielko-video-player /usr/local/nginx/html/player
#ip=$(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//' )
#sed -i -- 's/replaceip/'"$ip"'/g' /usr/local/nginx/html/stream.xml
#sed -i -- 's/replaceip/'"$ip"'/g' /usr/local/nginx/html/index.php
#enable Stunel for Support RTMPS
# source: https://sites.google.com/view/facebook-rtmp-to-rtmps/home
rm -rf /etc/default/stunnel4
cp ~/working/Tiyan/stunnel/stunnel4 /etc/default/
cp ~/working/Tiyan/stunnel/stunnel.conf /etc/stunnel/
sudo systemctl enable stunnel4.service
sudo systemctl restart stunnel4.service
#
ln -s /usr/local/nginx/sbin/nginx nginx
sudo service nginx start
sudo rm -rf ~/working
sudo chmod -R ugo+rwx /usr/local/nginx
history -c
shutdown -r now