#1.安装依赖包 yum -y install pcre* openssl* make #2.解压安装包 tar -xvf nginx-1.10.2.tar.gz cd nginx-1.10.2.tar.gz #3.安装nginx 3.1 ./configure --prefix=/usr/local/nginx-1.5.1 –with-http_ssl_module --with-http_spdy_module –with-http_stub_status_module --with-pcre
如果没有报错就表示环境检查OK了 #解释: –with-http_stub_status_module:支持nginx状态查询 –with-http_ssl_module:支持https –with-http_spdy_module:支持google的spdy,想了解请百度spdy,这个必须有ssl的支持 –with-pcre:为了支持rewrite重写功能,必须制定pcre 3.2 make && make install
#4.启动Nginx
/usr/local/nginx-1.10.2/sbin/nginx
试试访问: curl -s http://localhost |grep nginx.com
关闭: /usr/local/nginx-1.10.2/sbin/nginx -s stop
重启: /usr/local/nginx-1.10.2/sbin/nginx -s reload
转载请注明原文地址: https://ju.6miu.com/read-1240.html