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
相关推荐
Runner.DUT32 分钟前
SRIO入门之官方例程仿真验证
服务器·网络·数据库
打不了嗝 ᥬ᭄35 分钟前
进程间通信
linux·运维·服务器
Volunteer Technology36 分钟前
13015计算机系统原理-速记宝典
运维·网络·考研·总线·计算机系统原理·中央处理器
亲爱的非洲野猪37 分钟前
Nginx vs Spring Cloud Gateway:限流功能深度对比与实践指南
运维·nginx
石小千1 小时前
Nginx服务做负载均衡网关
运维·nginx·负载均衡
Neng_Miao1 小时前
权限管理命令
linux·运维·服务器
shandianchengzi1 小时前
【笔记】ROS1|5 ARP攻击Turtlebot3汉堡Burger并解析移动报文【旧文转载】
linux·运维·网络安全·机器人·arp·turtlebot
禁默2 小时前
进程生命周期管理:从创建到终止的完整逻辑
linux·运维·服务器
不念霉运4 小时前
Gitee:本土化DevOps平台如何助力中国企业实现高效研发协作
运维·gitee·devops
爱喝水的鱼丶4 小时前
SAP-ABAP:ABAP Open SQL 深度解析:核心特性、性能优化与实践指南
运维·开发语言·数据库·sql·性能优化·sap·abap