記錄安裝nginx過程
1.下載4個壓縮包:
pcre,rewrite模塊要用到,下載地址:https://ftp.pcre.org/pub/pcre/
zlib,gzip模塊要用到,下載地址:http://www.zlib.net/zlib-1.2....
openssl,ssl模塊用到,下載地址:https://www.openssl.org/source/
nginx,下載地址:http://nginx.org/en/download....
2.將它們放到/usr/local/下
3.安裝pcrehtml
# cd /usr/local/ # tar -zxvf pcre-8.38.tar.gz # cd pcre-8.38 # ./configure # make # make install
4.安裝zlibnginx
# cd /usr/local/ # tar -zxvf zlib-1.2.11.tar.gz # cd zlib-1.2.11 # ./configure # make # make install
5.安裝opensslc++
# cd /usr/local/ # tar -zxvf openssl-1.0.2l.tar.gz # cd openssl-1.0.2l # ./configure # make # make install
6.安裝nginx服務器
# cd /usr/local/ # tar -zxvf nginx-1.12.1.tar.gz # cd nginx-1.12.1 # ./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.38 --with-zlib=/usr/local/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.0.2l # make # make install
7.安裝完成,啓動nginx.net
# /usr/local/nginx/sbin/nginx
8.訪問服務器ip查看是否成功,完code
筆記:中間若是有報錯You need a C++ compiler for C++ support,須要安裝gcc+:htm
# yum install -y gcc gcc-c++