Ubuntu版本:20.04.1 LTS

Nginx版本:1.22.0

下载地址: https://nginx.org/en/download.html

上传目录:/usr/local/src

安装目录:/usr/local/nginx

源码安装

# 查看操作系统
cat /etc/os-release

# 解压
tar -zxf nginx-1.20.2.tar.gz
cd nginx-1.20.2 # 配置
./configure --prefix=/usr/local/nginx --with-pcre --with-http_ssl_module # 安装
make
make install # 添加nginx环境变量
echo "export PATH=$PATH:/usr/local/nginx/sbin" >> /etc/profile
source /etc/profile

# 修改配置文件
vim /usr/local/nginx/conf/nginx.conf
user www-data;

问题集锦

Unable to locate package wget

apt update && apt install -y wget

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

apt install -y build-essential

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

apt install -y libpcre3 libpcre3-dev

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

apt install -y libssl-dev

./configure: error: the HTTP gzip module requires the zlib library

apt install -y zlib1g-dev

Ubuntu 安装 Nginx的更多相关文章

  1. ubuntu安装nginx踩坑

    ubuntu安装nginx 安装nginx tar -zxvf nginx-1.15.5.tar.gz -C /usr/local/src 解压 cd /usr/local/src/nginx-1.1 ...

  2. ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library

    ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library 须要安装pcre包. sudo apt-get upd ...

  3. Ubuntu安装Nginx+PHP7.0.4+MySQL5.6

    安装Nginx 1.首先添加nginx_signing.key(必须,否则出错) $ wget http://nginx.org/keys/nginx_signing.key $ sudo apt-k ...

  4. Ubuntu 安装 Nginx 实现反向代理

    安装Nginx依赖库(ubuntu平台) 最近域名通过了备案, 想着应用总不能带着端口号访问吧, 于是在网上踩了很多坑, 终于找到了一步直达的方法,起码这一次很顺利的实现了 安装gcc g++的依赖库 ...

  5. ubuntu安装nginx和设置网站https访问

    安装nginx 在控制台 输入 sudo apt-get install nginx 等待安装成功之后.可以打开浏览器.输入你的域名或者ip地址会出现"Welcome to nginx!&q ...

  6. ubuntu安装Nginx

    什么都不说了 直接干 一.安装Nginx 首先从Nginx的官网下载最新的稳定版本1.14.0:nginx 1.解压安装包 1.root@ubuntu:tar -zxf nginx-1.14.0.ta ...

  7. ubuntu安装nginx pagespeed

    一.自动安装 使用最新稳定版本的ngx_pagespeed自动安装依赖项并构建最新的主线版nginx,请运行: $ sudo bash <(curl -f -L -sS https://ngxp ...

  8. ubuntu 安装nginx, 出现 Unable to locate package

    今天在初始化一台新的ubuntu 服务器时,敲上了 sudo apt-get install nginx 来安装nginx, 却发现提示:  Reading package lists... Done ...

  9. ubuntu安装nginx及其默认目录结构

    一. 安装包安装 1.1 安装Nginx $sudo apt-get install nginx Ubuntu安装之后的文件结构大致为: 所有的配置文件都在/etc/nginx下,并且每个虚拟主机已经 ...

  10. Ubuntu 安装nginx

    https://www.nginx.com/resources/admin-guide/load-balancer/ https://github.com/gplessis/dotdeb-nginx/ ...

随机推荐

  1. centos7安装MySql8.0.29教程

    个人名片: 对人间的热爱与歌颂,可抵岁月冗长 Github‍:念舒_C.ying CSDN主页️:念舒_C.ying 个人博客 :念舒_C.ying @ 目录 1 安装之前检测系统是否有自带的MySQ ...

  2. 深度剖析 | 【JVM深层系列】[HotSpotVM研究系列] JVM调优的"标准参数"的各种陷阱和坑点分析(攻克盲点及混淆点)「 1 」

    [易错问题]Major GC和Full GC的区别是什么?触发条件呢? 相信大多数人的理解是Major GC只针对老年代,Full GC会先触发一次Minor GC,不知对否?我参考了R大的分析和介绍 ...

  3. .NET周报【12月第2期 2022-12-15】

    国内文章 九哥聊Kestrel网络编程第一章:开发一个Redis服务器 https://mp.weixin.qq.com/s/HJYnBE-7wbvkAYHxQaq3eQ 我和拥有多个.NET 千星开 ...

  4. TypeError: __str__ returned non-string (type WebStepInfo)

    错误代码: class CaseStep(models.Model): id = models.AutoField(primary_key=True) casetep = models.Foreign ...

  5. 用Echarts实现SpreadJS引用从属关系可视化

    在金融行业,我们经常会有审计审查的需求,对某个计算结果进行审查,但是这个计算结果可能依赖多个单元格,而且会有会有多级依赖的情况,如果让我们的从业人员靠眼睛找,工作量巨大,而且准确性存疑,基本上死路一条 ...

  6. CSP-S2022 游记

    Day 998244350 模拟赛场场被学弟吊打.最后几天写了一堆随机化乱搞题以及奇怪的搜索,都是 CSP 不曾考的玩意(书接下文). 点分治已经敲烂了.最后两场每场一个. Day 499122175 ...

  7. 深入理解IOC并自己实现IOC容器

    title: 深入理解IOC并自己实现IOC容器 categories: 后端 tags: - .NET 背景介绍 平时开发的时候我们经常会写出这种代码: var optionA=new A(...) ...

  8. AtCoder Beginner Contest 282 G - Similar Permutation

    套路题 题意 求有多少个 \(1\) 到 \(n\) 的排列满足恰有 \(k\) 对在排列中相邻的数满足前小于后 \(2 \leq n \leq 500, 0 \leq k \leq (n - 1)\ ...

  9. vue3+quasar+capacitor开发多平台项目,使用cordova和capacitor插件(支持所有前端框架)

    先看文档 框架文档地址:https://quasar.dev/start/quasar-cli 创建项目 npm init quasar 运行与打包命令 npx quasar dev npx quas ...

  10. MySQL 合并查询union 查询出的行合并到一个表中

    在合并查询中,尤其是二分类的情况,在查询结果是相同列名的时候可以考虑合并查询.先查询出行的结果,再使用union或者union all合并查询结果. 另外如果 union 和 order by 一起使 ...