1.安裝gcc環境html
yum install gcc-c++
2.安裝pcre http://www.pcre.org/nginx
yum install -y pcre pcre-devel
3.安裝zlib http://www.zlib.net/c++
yum install -y zlib zlib-devel
4.安裝openssl https://www.openssl.org/source/.net
yum install -y openssl openssl-devel
5.去官網(http://nginx.org/en/download.html)下載最新版 nginxcode
wget -c https://nginx.org/download/nginx-1.12.1.tar.gz
6.編譯安裝nginxhtm
cd nginx ./configure make && make install
7.啓動中止nginx進程
/usr/local/nginx/sbin/nginx #啓動 /usr/local/nginx/sbin/nginx -s reload #從新加載 ps aux|grep nginx #查看nginx進程 root 17388 0.0 0.0 20404 652 ? Ss 17:44 0:00 nginx: master process sbin/nginx nobody 17389 0.0 0.0 20848 1244 ? S 17:44 0:00 nginx: worker process root 17392 0.0 0.0 103252 828 pts/0 S+ 17:44 0:00 grep nginx kill -9 17388 #中止nginx
sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directoryssl
ln -s /usr/local/lib/libpcre.so.1 /lib64/get
sbin/nginxopenssl