(1)安装PCRE库 cd /usr/local/ wget 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 (2) 安装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 ./configure make && make install (3) 安装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 (4) 安装 OpenSSL library yum -y install openssl openssl-devel (5)安装 nginx cd /usr/local/ wget http://nginx.org/download/nginx-1.8.0.tar.gz tar -zxvf nginx-1.8.0.tar.gz cd nginx-1.8.0 ./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 make && make install
到这里nglix就已经安装完成了:
然后我们安装好nginx之后,需要在系统的环境变量的配置文件中添加我们nginx的环境,
1 2 3
vim /etc/profile PATH=$PATH:/usr/local/nginx/sbin export PATH