首页 > 系统相关 >Nginx 源码安装

Nginx 源码安装

时间:2024-04-26 17:24:52浏览次数:18  
标签:http nginx -- module Nginx 源码 https 安装

 

Nginx官网:https://nginx.org

参考:

Nginx配置常用参数梳理

https://www.jb51.net/server/285538k8k.htm

nginx配置参数详解

https://blog.csdn.net/u013286192/article/details/136418472

Nginx 配置详解

https://www.runoob.com/w3cnote/nginx-setup-intro.html

查看nginx开启的模块功能

https://blog.51cto.com/u_13360/9667416

 更新和安装所需的库

sudo apt-get update
sudo apt-get install build-essential libpcre3 libpcre3-dev zlib1g-dev openssl libssl-dev

下载官网源码

wget https://nginx.org/download/nginx-1.26.0.tar.gz

解压

tar -xzvf nginx-1.26.0.tar.gz
cd nginx-1.26.0

 配置

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
sudo make 
sudo make install

创建全局链接

sudo ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx

常用命令查看: 

nginx -h

查看版本号:nginx -v

查看编译参数:nginx -V

查看当前工作进程:nginx -s process

停止服务:nginx -s stop

安全停止服务:nginx -s quit

检查配置文件语法错误:nginx -t

重新加载配置 (不停止服务):nginx -s reload

 常用模块

./configure \
--with-compat \
--with-debug \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_v2_module \
--with-http_dav_module \
--with-http_slice_module \
--with-threads \
--with-http_addition_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_sub_module 

 

根据 ip 统计请求信息

awk '{print \$1\}' nginx.access.log | sort | uniq -c | sort -n

 

标签:http,nginx,--,module,Nginx,源码,https,安装
From: https://www.cnblogs.com/fieldtianye/p/18160351

相关文章

  • 安装1Panel管理面板
    1Panel是一个现代化、开源的Linux服务器运维管理面板。 安装部署:curl-sSLhttps://resource.fit2cloud.com/1panel/package/quick_start.sh-oquick_start.sh&&bashquick_start.sh 手动安装dockerhttps://docker-practice.github.io/zh-cn/install/raspberry-pi.ht......
  • centos 离线环境安装docker
    1.下载dockerhttps://download.docker.com/linux/static/stable/x86_64/docker-23.0.1.tgz  其他版本在上级目录选择下载https://download.docker.com/linux/static/stable/x86_64/2.下载的文件上传到centos服务器上并解压tar-zxvfdocker-23.0.1.tgz3.复制解压目录中的......
  • npm常用命令及安装
    安装#添加NodeSource的RPM存储库curl-sLhttps://rpm.nodesource.com/setup_12.x|sudobash-#安装Node.js和NPMsudoyuminstall-ynodejs常用切换版本命令n#安装[root@test-dlyun-rabbitmq~]#npminstall-gn#查看n工具已经安装的node.js版本......
  • Linux环境下Docker安装和基本使用命令
    以下是在CentOS7.9上安装Docker的步骤:1.更新系统并安装必要的软件包sudoyumupdatesudoyuminstall-yyum-utilsdevice-mapper-persistent-datalvm22.添加DockerCE的软件源sudoyum-config-manager--add-repohttps://download.docker.com/linux/centos/......
  • 通过设置nginx的client_max_body_size解决nginx+php上传大文件的问题
    通过设置nginx的client_max_body_size解决nginx+php上传大文件的问题用nginx来做webserver的时,上传大文件时需要特别注意client_max_body_size这个参数,否则会中断在nginx的请求中,在php中是无法记录到访问的. 一般上传大文件流程: 首先修改php.ini文件: 参数设置说明 fi......
  • Vsphere中ubuntu带桌面模板安装vmtools
    ①编辑虚拟机设置如果有读ISO文件,将其改为“客户端设备”。 ②选择"安装vmwaretools",选择"挂载"或者“是" ③进入虚拟机,发现”media/用户名/”下出现VMwareTools文件夹。sudosu切换为root,在/下新建一个文件夹,将文件夹下的tar.gz包,复制到该文件夹下,并解压缩。④进入......
  • nginx高级篇之location高级实战
    nginxlocation高级实战location是nginx的核心重要功能,可以设置网站的访问路径,一个webserver会有多个路径,那么location就得设置多个。Nginx的locaiton作用是根据用户请求的URI不同,来执行不同的应用。针对用户请求的网站URL进行匹配,匹配成功后进行对应的操作。1.语法介绍Sy......
  • springBoot源码(一)
    构造函数运行代码publicConfigurableApplicationContextrun(String...args){ Startupstartup=Startup.create(); if(this.registerShutdownHook){ SpringApplication.shutdownHook.enableShutdownHookAddition(); } DefaultBootstrapContextbootstrapConte......
  • nginx高性能负载均衡集群
    高性能负载均衡集群一、集群是什么简单地说,集群就是指一组(若干个)相互独立的计算机,利用高速通信网络组成的一个较大的计算机服务系统,每个集群节点(即集群中的每台计算机)都是运行各自服务的独立服务器。这些服务器之间可以彼此通信,协同向用户提供应用程序,系统资源和数据,并以单一......
  • PostgreSQL14.11一键启动免安装绿色版
    PostgreSQL14.11_x64一键启动免安装版使用方法:解压后,将整个文件夹放到你希望的位置,注意路径不要包含中文。双击运行bat即可,第一次打开会自动初始化数据库目录。注意:pgsql15版本以后,需要使用navicat16.2以上版本才可以正常连接。想使用最新版本的PostgreSQL16.2,可以下载P......