1. 源码安装nginx
- 安装依赖
[root@xuegod13 ~]# yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel
- 创建nginx用户,解压源码包
[root@xuegod13 ~]# useradd -s /sbin/nologin -M nginx
[root@xuegod13 ~]# tar xf nginx-1.18.0.tar.gz
[root@xuegod13 ~]# cd nginx-1.18.0/
[root@xuegod13 nginx-1.18.0]# ls
auto CHANGES.ru configure html man src
CHANGES conf contrib LICENSE README - 安装
[root@xuegod13 nginx-1.18.0]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-pcre