下载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.youkuaiyun.com/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
本文详细介绍了如何从Nginx官网下载并安装最新版本的Nginx,包括解压、配置、编译和安装等步骤。针对在安装过程中可能遇到的如C编译器未找到、缺少PCRE库和OpenSSL库等问题提供了具体解决方案,如通过yum安装gcc、pcre-devel和openssl-devel。此外,还解决了启动Nginx时出现的权限和目录不存在等错误。

被折叠的 条评论
为什么被折叠?



