释放双眼,带上耳机,听听看~!
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
73
74
75
76
77
78
79
80
81
82 1#!/bin/bash
2set -x
3PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
4export PATH
5# Check if user is root
6if [ $(id -u) != "0" ]; then
7 echo "Error: You must be root to run this script, please use root to install this shell script"
8 exit 1
9fi
10yum -y install gcc wget gcc-c++ automake autoconf libtool libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed pcre pcre-devel openssl openssl-devel zlib zlib-devel
11groupadd -r nginx
12useradd -r -g nginx nginx
13#install pcre
14cd /usr/local/src/
15wget https://ftp.pcre.org/pub/pcre/pcre-8.21.tar.gz
16tar zxvf pcre-8.21.tar.gz
17cd pcre-8.21/
18./configure
19make && make install
20cd ../
21#install zlib
22wget http://www.zlib.net/zlib-1.2.11.tar.gz
23tar -zxvf zlib-1.2.11.tar.gz
24cd zlib-1.2.11
25./configure
26make
27make install
28cd ../
29#install ssl
30#wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
31#tar -zxvf openssl-1.0.1c.tar.gz
32#cd openssl-1.0.1c
33#./config
34#make
35#make install
36#cd ../
37#--with-openssl=/usr/local/src/openssl-1.0.1c \
38#install nginx_cache
39wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
40tar xf ngx_cache_purge-2.3.tar.gz
41#install nginx
42wget http://nginx.org/download/nginx-1.12.2.tar.gz
43tar zxvf nginx-1.12.2.tar.gz
44cd nginx-1.12.2/
45./configure \
46--prefix=/usr/local/nginx \
47--user=nginx \
48--group=nginx \
49--with-pcre=/usr/local/src/pcre-8.21 \
50--with-zlib=/usr/local/src/zlib-1.2.11 \
51--with-http_ssl_module \
52--with-http_v2_module \
53--with-http_realip_module \
54--with-http_addition_module \
55--with-http_sub_module \
56--with-http_dav_module \
57--with-http_flv_module \
58--with-http_mp4_module \
59--with-http_gunzip_module \
60--with-http_gzip_static_module \
61--with-http_random_index_module \
62--with-http_secure_link_module \
63--with-http_stub_status_module \
64--with-http_auth_request_module \
65--with-mail \
66--with-mail_ssl_module \
67--with-file-aio \
68--with-ipv6 \
69--with-http_v2_module \
70--with-threads \
71--with-stream \
72--with-stream_ssl_module \
73--add-module=../ngx_cache_purge-2.3
74make && make install
75cd ../
76cp nginx /etc/init.d/nginx
77chmod +x /etc/init.d/nginx
78chkconfig --add nginx
79chkconfig nginx on
80/etc/init.d/nginx start
81ps aux |grep nginx
82