IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> nginx编译及安装问题集锦 -> 正文阅读

[系统运维]nginx编译及安装问题集锦

目录

问题一、error: the HTTP rewrite module requires the PCRE library.

问题二、error: the HTTP gzip module requires the zlib library.

问题三、invalid PID number "" in "/apps/srv/nginx1.18/logs/nginx.pid"

问题四、unknown directive "ssl_certificate"

问题五、open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)


问题一、error: the HTTP rewrite module requires the PCRE library.

./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 -y install pcre-devel

截图:

问题二、error: the HTTP gzip module requires the zlib library.

./configure: error: the HTTP gzip module requires the zlib library.
You can either disable the module by using --without-http_gzip_module
option, or install the zlib library into the system, or build the zlib library
statically from the source with nginx by using --with-zlib=<path> option.

解决:

yum install -y zlib-devel

截图:

问题三、invalid PID number "" in "/apps/srv/nginx1.18/logs/nginx.pid"

2021/06/02 14:04:11 [notice] 21603#0: signal process started
2021/06/02 14:04:11 [error] 21603#0: invalid PID number "" in "/apps/srv/nginx1.18/logs/nginx.pid"

解决:

没有找到PID对应的nginx进程,所以,如果我们想重启nginx服务的话是有问题的。

我们可以直接运行如下命令启动nginx服务:

./nginx

而不是使用:

./nginx -s reload

当然还有另外一种可能,就是已经存在nginx服务干扰了新服务启动,我们可以使用如下命令查看当前nginx服务的运行状态:

ps -aux | grep nginx

然后,根据PID,干掉对应的nginx服务,再重新启动nginx服务。?

kill -9 pid

截图:

问题四、unknown directive "ssl_certificate"

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
2021/06/02 14:23:02 [emerg] 21702#0: unknown directive "ssl_certificate" in /etc/nginx/conf.d/test-oss-01.test.cn.conf:21

解决:

比较常见的原因是证书路径不对或者编译nginx过程中没有指定ssl模块。

如果是前者的话,我们可以修改 test-oss-01.test.cn.conf 配置文件中引用的 *.crt 和 *.key 的路径。

如果是后者的话,我们可以使用如下命令设置编译选项,再执行 make 命令重新编译。

./configure --with-http_ssl_module ?//重新添加这个ssl模块

截图:

问题六、open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)

nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)

解决:

执行命令前边增加sudo即可

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2021-07-14 23:19:00  更:2021-07-14 23:19:29 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/5 2:47:17-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码