1.查看系统中是否存在zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre
rpm -qa | grep -i zlib
2.如果没有进行安装不存在的应用
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
3.解压nginx压缩包
4.编译安装nginx
./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
make
make install
启动:/usr/local/nginx/sbin/nginx
重新载入配置文件:/usr/local/nginx/sbin/nginx -s reload
重启:/usr/local/nginx/sbin/nginx -s reopen
停止:/usr/local/nginx/sbin/nginx -s stop