yum install -y gcc gcc-c++ cd /usr/local 安装pcre wgetr http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz tar -zxvf pcre-8.33.tar.gz // 解压 cd pcre-8.33 ./configure make && make install
安装ssl库 cd /usr/local wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz tar -zxvf openssl-1.0.1j.tar.gz cd openssl-1.0.1j ./config make && make install
安装zlib库 cd /usr/local wget http://zlib.net/zlib-1.2.11.tar.gz tar -zxvf zlib-1.2.11.tar.gz cd zlib=1.2.11 ./configure make && make install
安装nginx cd nginx-1.6.11 $ ./configure --user=nobody --group=nobody --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_sub_module --with-http_ssl_module --with-stream make && make install
若出现以下错误:
./configure: error:SSL modules reguire the openssl library
则执行
yum -y install openssl openssl-devel
注意一个报错
unknown directive “stream” in /usr/local/nginx/nginx.conf:16