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
相关推荐
楚枫默寒3 小时前
Linux 编辑文件后自动添加修改日期
linux·运维·bash
苦青藤4 小时前
从零搭建 WSUS 隔离网络:完整实战指南(内网离线补丁分发)
运维·windows·microsoft
天天进步20157 小时前
Python全栈项目--Python自动化运维工具开发
运维·python·自动化
Soari7 小时前
Ubuntu 根分区文件系统损坏,系统启动时自动检查失败
linux·运维·ubuntu
杨云龙UP8 小时前
Oracle Health Check巡检脚本使用SOP V2.0:从HTML原始报告→生成Word专业巡检报告→交付客户_2026-06-03
linux·运维·数据库·sql·oracle·报告·巡检
广州灵眸科技有限公司8 小时前
瑞芯微RV1126B开发板(EASY-EAI-PI2) Linux虚拟机准备
linux·运维·服务器
Lana学习中8 小时前
【运维杂记】连接不上远程服务器的问题处理
运维·服务器
189228048619 小时前
NV023固态MT29F16T08GWLCEJ9-QBES:C
大数据·服务器·人工智能·科技·缓存
AOwhisky9 小时前
MySQL 学习笔记(第一期):数据库基础与 MySQL 初探
运维·数据库·笔记·学习·mysql·云计算
Peace9 小时前
【Prometheus】
linux·运维·prometheus