centos 安装最新版 nginx

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

相关文章
相关标签/搜索