1.下载
wget http://nginx.org/download/nginx-1.7.8.tar.gz
2.解压
tar -zxvf nginx-1.7.8.tar.gz
3.切换目录
cd nginx-1.7.8
4.安装
./configure --prefix=/usr/local/nginx-1.7.8 \
--with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module --with-pcre
此时发生了错误:
错误1:./configure: error: the HTTP rewrite module requires the PCRE library.
解决:yum -y install pcre*
错误2:./configure: error: SSL modules require the OpenSSL library.
解决:yum -y install openssl*
然后
make
make install
5.启动
/usr/local/nginx-1.7.8/sbin/nginx
6.关闭防火墙
service iptables stop