Code Ease Code Ease
  • 个人博客网站 (opens new window)
  • 好用的工具网站 (opens new window)
  • Java核心基础
  • 框架的艺术
  • 分布式与微服务
  • 开发经验大全
  • 设计模式
  • 版本新特性
数据库系列
大数据+AI
  • xxl-job
运维与Linux
  • 基于SpringBoot和BootStrap的论坛网址
  • 基于VuePress的个人博客网站
  • 基于SpringBoot开发的小功能
  • 做一个自己的IDEA插件
程序人生
关于我
  • 分类
  • 标签
  • 归档

神秘的鱼仔

你会累是因为你在走上坡路
  • 个人博客网站 (opens new window)
  • 好用的工具网站 (opens new window)
  • Java核心基础
  • 框架的艺术
  • 分布式与微服务
  • 开发经验大全
  • 设计模式
  • 版本新特性
数据库系列
大数据+AI
  • xxl-job
运维与Linux
  • 基于SpringBoot和BootStrap的论坛网址
  • 基于VuePress的个人博客网站
  • 基于SpringBoot开发的小功能
  • 做一个自己的IDEA插件
程序人生
关于我
  • 分类
  • 标签
  • 归档
服务器
  • 技术相关

  • 安装文档

    • Nginx安装文档
      • Nginx安装
    • ClickHoust搭建文档
    • ElasticSearch搭建文档
    • JDK8在线及离线安装
    • MySQL单机主从离线部署
    • Kibana搭建文档
    • Python3.9及3.10安装文档
  • 计算机与Linux
  • 安装文档
CodeEase
2024-07-01
目录

Nginx安装文档

作者:鱼仔
博客首页: codeease.top (opens new window)
公众号:Java鱼仔

# Nginx安装

本文通过在线安装的方式进行Nginx的安装

cd /usr/local/
mkdir nginx
cd nginx/

wget -c https://nginx.org/download/nginx-1.23.3.tar.gz
tar -zxvf nginx-1.23.3.tar.gz
cd nginx-1.23.3/

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_sub_module --with-http_gzip_static_module --with-pcre
1
2
3
4
5
6
7
8
9

如果出现下面的结果,说明配置成功

Configuration summary
  + using system PCRE library
  + using system OpenSSL library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

最后启动

cd /usr/local/nginx/sbin
./nginx
1
2

访问IP地址,弹出Nginx的页面就说明启动成功

需要记住的一些命令

./nginx -s quit #(温和)此方式停止步骤是待nginx进程处理任务完毕进行停止。
./nginx -s stop #(强硬)此方式相当于先查出nginx进程id再使用kill命令强制杀掉进程。
./nginx -s reload # 重启nginx(不推荐此方法,推荐先停止在启动)
1
2
3

你可能会遇到下面这些问题:

问题:./configure: error: C compiler cc is not found

yum -y install gcc gcc-c++ autoconf automake make
1

问题:./configure: error: the HTTP rewrite module requires the PCRE library

yum install pcre pcre-devel
1

问题:./configure: error: SSL modules require the OpenSSL library.

yum install openssl openssl-devel
1
上次更新: 2025/02/18, 11:30:08
Linux下的日志,如何优雅地管理
ClickHoust搭建文档

← Linux下的日志,如何优雅地管理 ClickHoust搭建文档→

最近更新
01
AI大模型部署指南
02-18
02
半个月了,DeepSeek为什么还是服务不可用
02-13
03
Python3.9及3.10安装文档
01-23
更多文章>
Theme by Vdoing | Copyright © 2023-2025 备案图标 浙公网安备33021202002405 | 浙ICP备2023040452号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式