File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ cat << EOF
4+
5+ ###################################################################################
6+ # 安装 nginx 脚本
7+ # nginx 会被安装到 /opt/nginx 路径。
8+ # 注意:安装 nginx 需要依赖以下库,需预先安装:
9+ # zlib zlib-devel gcc-c++ libtool openssl openssl-devel
10+ # @system: 适用于所有 linux 发行版本。
11+ # @author: Zhang Peng
12+ ###################################################################################
13+
14+ EOF
15+
16+ version=1.12.2
17+ if [[ -n $1 ]]; then
18+ version=$1
19+ fi
20+
21+ root=/opt/nginx
22+ if [[ -n $2 ]]; then
23+ root=$2
24+ fi
25+
26+ echo -e " \n>>>>>>>>> install libs"
27+ yum install -y zlib zlib-devel gcc-c++ libtool openssl openssl-devel
28+
29+ # 首先要安装 PCRE,PCRE 作用是让 nginx 支持 Rewrite 功能
30+ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/pcre-install.sh | bash
31+
32+ echo -e " \n>>>>>>>>> download nginx"
33+ mkdir -p ${root}
34+ wget -O ${root} /nginx-${version} .tar.gz http://nginx.org/download/nginx-${version} .tar.gz
35+
36+ # 编译
37+ tar zxf ${root} /nginx-${version} .tar.gz -C ${root}
38+ cd ${root} /nginx-${version}
39+ ./configure --with-http_stub_status_module --with-http_ssl_module --with-pcre=${pcreRoot} /pcre-${pcreVersion}
40+ nginx -v
41+ cd -
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ cat << EOF
4+
5+ ###################################################################################
6+ # 安装 pcre 脚本
7+ # @system: 适用于所有 linux 发行版本。
8+ # @author: Zhang Peng
9+ ###################################################################################
10+
11+ EOF
12+
13+ version=8.35
14+ if [[ -n $1 ]]; then
15+ version=$1
16+ fi
17+
18+ root=/opt/pcre
19+ if [[ -n $2 ]]; then
20+ root=$2
21+ fi
22+
23+ echo -e " \n>>>>>>>>> donwload pcre"
24+ mkdir -p ${root}
25+ wget -O ${root} /pcre-${version} .tar.gz http://downloads.sourceforge.net/project/pcre/pcre/${version} /pcre-${version} .tar.gz
26+
27+ echo -e " \n>>>>>>>>> install pcre"
28+ tar zxf ${root} /pcre-${version} .tar.gz -C ${root}
29+ cd ${root} /pcre-${version}
30+ ./configure
31+ make && make install
32+ pcre-config --version
33+ cd -
Original file line number Diff line number Diff line change @@ -30,5 +30,5 @@ wget -O ${root}/redis-${version}.tar.gz http://download.redis.io/releases/redis-
3030echo -e " \n>>>>>>>>> install redis"
3131tar zxf ${root} /redis-${version} .tar.gz -C ${root}
3232cd ${root} /redis-${version}
33- make & make install
33+ make && make install
3434cd -
You can’t perform that action at this time.
0 commit comments