作者QQ:67065435 QQ群:821635552
安装前的准备
yum install \
vim \
gcc \
gcc-c++ \
wget \
make \
libtool \
automake \
autoconf \
-y
安装PCRE库
cd /root
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -zxvf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
make install
安装zlib库
cd /root
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
make install
安装openssl
# openssl从1.0.2开始支持http2
cd /root
wget https://www.openssl.org/source/openssl-1.0.2u.tar.gz
tar -zxvf openssl-1.0.2u.tar.gz
安装nginx
# nginx在1.9.5开始支持http2
cd /root
wget http://nginx.org/download/nginx-1.17.9.tar.gz
tar -zxvf nginx-1.17.9.tar.gz
cd nginx-1.17.9
# 安装前小提示:如果要隐藏Web服务名称'nginx',可以使用以下方法,但该方法会导致不兼容certbot免费证书生成工具
|——————————————————————————————————————
| vim ./src/core/nginx.h
|
| #define NGINX_VERSION "x.x.x"
| #define NGINX_VER "nginx/" NGINX_VERSION
| # 改为
| #define NGINX_VERSION "1.0.0"
| #define NGINX_VER "FastWeb/" NGINX_VERSION
|
| ESC
| :wq
|——————————————————————————————————————
|——————————————————————————————————————
| vim ./src/http/ngx_http_header_filter_module.c
|
| ngx_http_server_string[] = "Server: nginx" CRLF;
| # 改为
| ngx_http_server_string[] = "Server: FastWeb" CRLF;
|
| ESC
| :wq
|——————————————————————————————————————
|——————————————————————————————————————
| vim ./src/http/ngx_http_special_response.c
|
nginx
| # 改为
| FastWeb
|
| # 并且
|
| static u_char ngx_http_msie_padding[] =
| "" CRLF
| "" CRLF
| "" CRLF
| "" CRLF
| "" CRLF
| "" CRLF;
| # 改为
| static u_char ngx_http_msie_padding[] = "" CRLF;
|
| # 并且
|
| static u_char ngx_http_error_tail[] =
| "nginx
" CRLF
| "
" CRLF | "