Anolis系统安装nginx

Anolis系统安装nginx

一、下载安装包

登录https://nginx.org/en/download.html查看最新稳定版本,下载最新稳定版本

shell 复制代码
wget https://nginx.org/download/nginx-1.26.0.tar.gz

二、解压安装包并编译

shell 复制代码
#解压
tar -zvxf nginx-1.26.0.tar.gz
#进入文件夹
cd nginx-1.26.0
#配置并编译
./configure --with-http_ssl_module --with-http_gzip_static_module
make
make install

在配置时可能会遇到pcre的问题

shell 复制代码
./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.

此时可以根据提示使用--without-http_rewrite_module参数取消该模块。或者安装pcre,该文选择后者进行处理

shell 复制代码
yum install -y pcre pcre-devel

在配置时可能会遇到OpenSSL的问题

shell 复制代码
./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.

需要进行安装

shell 复制代码
yum install -y openssl openssl-devel

三、启动nginx

进入/usr/local/nginx/sbin目录

shell 复制代码
cd /usr/local/nginx/sbin
#启动nginx
./nginx
#查看nginx状态
ps aux | grep nginx
#加载指定conf文件
./nginx -c conf/nginx_1.conf
相关推荐
梦想blog19 分钟前
漏洞修复 CentOS x86_64 OpenSSH 升级操作文档
linux·运维·centos·ssh·漏洞修复
青草地溪水旁4 小时前
EPOLLONESHOT事件类型和ET模式有什么区别?
服务器·网络·c++·epoll
林开落L4 小时前
Linux 进程信号:从进阶特性到实战应用(下)
linux·运维·服务器·进程信号
初听于你5 小时前
缓存技术揭秘
java·运维·服务器·开发语言·spring·缓存
云手机掌柜6 小时前
技术深度解析:指纹云手机如何通过设备指纹隔离技术重塑多账号安全管理
大数据·服务器·安全·智能手机·矩阵·云计算
程序猿阿伟7 小时前
《重构工业运维链路:三大AI工具让设备故障“秒定位、少误判”》
运维·人工智能·重构
蜀山雪松8 小时前
全网首先 Docker Compose 启动Postgresql18
运维·docker·容器
Turboex邮件分享8 小时前
Syslog日志集成搭建
运维·elasticsearch·集成测试
口嗨农民工8 小时前
win10默认搜索APP和window设置控制命板
linux·服务器·c语言
YongCheng_Liang8 小时前
网络工程师笔记8-OSPF协议
运维·网络·网络协议