Nginx的各种报错总结
时间:2022-04-24
本文章向大家介绍Nginx的各种报错总结,主要内容包括1、Nginx安装过程报错、错误二:软件依赖包未正确安装问题---OPENSSL依赖包没有安装、错误三:编译安装pcre编译软件时,gcc不全导致报错(使用yum安装不存在此问题)。、2、Nginx启动过程中报错、错误二:403报错、错误三:启动 Nginx 时如下报错"nginx:[emerg]getpwnam(“nginx”)failed"、基本概念、基础应用、原理机制和需要注意的事项等,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。
1、Nginx安装过程报错
错误一:软件依赖包未正确安装问题---PCRE依赖包没有安装
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决方法:yum install pcre pcre-devel -y
错误二:软件依赖包未正确安装问题---OPENSSL依赖包没有安装
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
解决方法:yum install openssl openssl-devel -y
错误三:编译安装pcre编译软件时,gcc不全导致报错(使用yum安装不存在此问题)。
报错信息如下:
[root@gjlin2 pcre-8.30]# make && make install
make all-am
make[l]: Entering directory 7h〇me/gjlin/tools/pcre-8.30*
CXX pcrecpp.lo
libtool: compile : unrecognized option '-DHAVE_CONFIG_H'
libtool:compile : Try 'libtool --help' for more information.
make[l]:***[pcrecpp.lo]错误 1
make[l]:Leaving directory '/home/gjlin/tools/pcre-8.30'
make : *** [all]错误 2
解答:执行"yum -y install gcc-c++"命令安装gcc-c++依赖包。
2、Nginx启动过程中报错
错误一:nginx软件重复启动产生的错误信息
[root@web01 nginx-1.10.2]# /application/nginx/sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
解决方法:nginx软件已经启动无需反复启动,如果需要重新启动需要停止nginx进程或者用reload方式进行重启
错误二:403报错
- 服务阻止客户端访问
- 服务端站点目录中,没有指定首页文件信息
错误三:启动 Nginx 时如下报错"nginx:[emerg]getpwnam(“nginx”)failed"
解答:这是因为没有对应的Nginx服务用户,执行useradd nginx -s /sbin/nologin -M创建Nginx用户即可。为了让读者理解问题,重现上述错误过程,命令如下:
[root@web tools]# pkill nginx
[root@web tools]# userdel nginx
[root@web tools]# /application/nginx/sbin/nginx
nginx: [emerg] getpwnam(Mnginx") failed
[root@web tools]# useradd nginx -s /sbin/nologin -M
[root@web tools]# /application/nginx/sbin/nginx
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- java_static、final、super、this关键字的使用
- Lambda表达式
- java_字节流、字符流
- HashMap源码分析
- [周末往期回顾]使用cx_Oracle连接Oracle
- java_数组的定义与操作
- LinkedList源码分析
- MarkDown语法的详细使用教程
- java_内部类、匿名内部类的使用
- [周末往期回顾]使用BBED定位数据位置
- JeecgCloud版,新建项目。
- MySQL忘记root密码,错误号码1045解决办法
- java_流程控制语句、权限修饰符
- [Oracle 故障处理]记一次RMAN备份警告的处理过程
- [Oracle 日常管理]使用oradebug捕获SQL语句