Nginx编译安装
安装前的准备
yum install -y vim lrzsz tree screen psmisc lsof tcpdump wget ntpdate gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools iotop bc zip unzip zlib-devel bash-completion nfs-utils automake libxml2 libxml2-devel libxslt libxslt-devel perl perl-ExtUtils-Embed
1.1 安装Nginx
官方源码包下载地址:
https://nginx.org/en/download.html
nginx-1.16.1地址:https://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost@~]->cd /usr/local/src/
[root@localhost@src]->wget https://nginx.org/download/nginx-1.16.1.tar.gz
[root@localhost@src]->tar xvf nginx-1.16.1.tar.gz
[root@localhost@src]->cd nginx-1.16.1
1.2 编译
[root@localhost@nginx-1.16.1]->./configure --prefix=/apps/nginx \ # 选择安装目录
> --user=nginx \ # 选择属主
> --group=nginx \ # 选择属组
> --with-http_ssl_module \ # 选择安装的模组
> --with-http_v2_module \
> --with-http_realip_module \ # 开启转发后,往后端服务器转发用户真实地址
> --with-http_stub_status_module \ # 开启状态页
> --with-http_gzip_static_module \
> --with-pcre \ # 开启正则表达式
> --with-stream \