当前位置: 首页 > news >正文

安装Nginx

如果没有gcc环境,需要安装gcc
yum install gcc-c++
安装依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
工作目录
mkdir /opt/nginx && cd /opt/nginx
下载安装包
wget http://nginx.org/download/nginx-1.32.1.tar.gz
解压安装包
tar -xvf nginx-1.23.1.tar.gz
安装目录
cd nginx-1.23.1
安装
./configure --prefix=/usr/local/nginx --conf-path=/usr/local/nginx/conf/nginx.conf  --error-log-path=/usr/local/nginx/logs/error.log --pid-path=/usr/local/nginx/logs/nginx.pid  --http-log-path=/usr/local/nginx/logs/access.log --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module

其中,
#执行命令
#prefix= 指向安装目录(编译安装)
#conf-path= 指向配置文件(nginx.conf)
#error-log-path= 指向错误日志目录
#pid-path= 指向pid文件(nginx.pid)
#http-log-path= 设定access log路径
#with-http_gzip_static_module 启用ngx_http_gzip_static_module支持(在线实时压缩输出数据流)
#with-http_stub_status_module 启用ngx_http_stub_status_module支持(获取nginx自上次启动以来的工作状态)
#with-http_ssl_module 启用ngx_http_ssl_module支持(使支持https请求,需已安装openssl)

执行命令
make
执行make install命令
make install
启动nginx
cd /usr/local/nginx/sbin
./nginx
查看nginx进程
ps -ef | grep nginx
http://www.lryc.cn/news/346850.html

相关文章:

  • 爬虫工具you-get
  • hal_stm32_RTC函数
  • 【大数据·Hadoop】从词频统计由浅入深介绍MapReduce分布式计算的设计思想和原理
  • win10建立共享文件夹和ipad共享文件
  • 手机在网状态多方面重要性
  • Multitouch for Mac:手势自定义,提升工作效率
  • IDEA创建springboot项目时不能选择java 8或者java 11等等版本的问题,解决方案
  • SpringCloudAlibaba:4.3云原生网关higress的JWT 认证
  • 【机器学习】Reinforcement Learning-强化学习基本概念
  • vim编辑器---(1)vim编辑器介绍?
  • 解密 Unix 中的 “rc“ 后缀:自定义你的工作环境
  • Java使用csv导出多字段大数据文件(无需写实体映射,自动遍历)
  • Redis 本机无法访问
  • 【论文笔记】Training language models to follow instructions with human feedback B部分
  • stm32——OLED篇
  • 重卡生产流程的可视化管理与优化
  • 软考-软件工程
  • Agent AI智能体:未来社会的角色、发展路径与挑战
  • Vue 3.x组件生命周期
  • onnx模型截取部分
  • 中职智慧校园建设内容规划
  • GitLab CI/CD的原理及应用详解(一)
  • Python混淆矩阵用例
  • 【负载均衡式在线OJ项目day6】源文件路由功能及文件版题库构建
  • 841.钥匙和房间
  • 【OceanBase 系列】—— 什么是冻结和转储
  • 智慧园区能耗管控系统,3D可视化开发都需要哪些技术栈?
  • Spring之推断构造方法源码解析
  • 【计算机网络】计算机网络的定义和分类
  • 天机学堂—学习辅助功能(含场景问答和作业)