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
#!/bin/bash
DIR=$HOME/nginx
mkdir $DIR/src -p
cd $DIR/src
git clone https://github.com/arut/nginx-rtmp-module
wget http://kent.dl.sourceforge.net/sourceforge/pcre/pcre-8.40.tar.gz
tar -xzvf pcre-8.40.tar.gz
wget http://nginx.org/download/nginx-1.13.0.tar.gz
tar -xzvf nginx-1.13.0.tar.gz
cd nginx-1.13.0
./configure --prefix=$DIR --with-cc-opt="-Wno-error" --with-http_ssl_module --with-file-aio --with-pcre=../pcre-8.40 --add-module=../nginx-rtmp-module
make
make install
cd $DIR
echo -e "#!/bin/bash\n./sbin/nginx" > startng
echo -e "#!/bin/bash\n./sbin/nginx -s stop" > stopng
echo -e "#!/bin/bash\n./sbin/nginx -t && ./sbin/nginx -s reload" > reloadng
chmod +x {startng,stopng,reloadng}
wget https://twily.info/nginxfiles/vjs/twily-stream-service.html -O twily-stream-service.html
wget https://twily.info/nginxfiles/vjs/camonline.txt -O camonline.txt
wget https://twily.info/nginxfiles/nginx.conf -O nginx.conf
wget https://twily.info/nginxfiles/makethumb -O makethumb
mkdir html
mv twily-stream-service.html html/twily-stream-service.html
mv camonline.txt html/camonline.txt
mv conf/nginx.conf conf/nginx.conf.bk
mv nginx.conf conf/nginx.conf
chmod +x ./makethumb
ln -s html/twily-stream-service.html twily-stream-service.html
ln -s conf/nginx.conf nginx.conf
echo -e "\n>NGINX has been installed to \"$DIR\".\n"
exit
Top