下载ngxin 最新版本 nginx 官方网站 http://nginx.org/en/download.html
解压 tar -zxvf nginx-1.14.0.tar.gz
进入解压目录,执行:
./configrue
如果报错
checking for C compiler ... not found
安装gcc
yum install gcc
然后重复执行 ./configrue
参考https://blog.csdn.net/hejun1218/article/details/72473218
如果报错
./configure: error: the HTTP rewrite module requires the PCRE library
安装pcre-devel解决问题
yum -y install pcre-devel
报错
./configure: error: SSL modules require the OpenSSL library.
安装 yum -y install openssl openssl-devel
然后执行:
make && make install
执行nginx命令报错 [emerg]: getpwnam(“nginx”) failed
参考:https://www.cnblogs.com/love3556/p/5962388.html
启动nginx 报错
nginx: [emerg] mkdir() "/var/cache/nginx/client_temp" failed (2: No such file or directory)
手动创建 文件夹 mkdir /var/cache/nginx/client_temp
再次启动 ok