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
相关推荐
网络安全(华哥)1 小时前
网络安全服务实施流程管理 网络安全服务体系
运维·服务器·网络
致奋斗的我们1 小时前
Nginx反向代理及负载均衡
linux·运维·mysql·nginx·负载均衡·shell·openeluer
Ares-Wang1 小时前
负载均衡 方式
运维·负载均衡
钗头风1 小时前
3.Docker常用命令
运维·docker·容器
忧虑的乌龟蛋2 小时前
嵌入式 Linux:使用设备树驱动GPIO全流程
linux·服务器·嵌入式·imx6ull·gpio·点灯·pinctrl
朝九晚五ฺ2 小时前
【Linux探索学习】第三十弹——线程互斥与同步(上):深入理解线程保证安全的机制
linux·运维·学习
六六六六六66662 小时前
企业组网IP规划与先关协议分析
服务器·网络·tcp/ip
不要吃栗子李2 小时前
高级运维:1. 对比 LVS 负载均衡群集的 NAT 模式和 DR 模式,比较其各自的优势 。2. 基于 openEuler 构建 LVS-DR 群集。
运维·负载均衡·lvs
ITPUB-微风2 小时前
网易严选DevOps实践:从传统到云原生的演进
运维·云原生·devops
roman_日积跬步-终至千里3 小时前
【Flink实战】Flink网络内存和托管内存
服务器·网络·flink