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. Javascript | 分别用async await异步方法和Promise来实现一个简易的求职程序

      关注公众号,一起交流,微信搜一搜: LiOnTalKING   JavaScript Promise Promise 是一个 ECMAScript 6 提供的类,目的是更加优雅地书写复杂的异步任务 ...

  2. 对象和类—Java世界的细胞

    对象和类-Java世界的细胞 今天向大家介绍我自己关于Java中对象和类的一些体会,中有不足还请大家多多指教 1.面向对象程序设计 为什么会产生面向对象 我认为人们在最初探索计算机世界时,常常会从计算 ...

  3. 使用time.Time数据类型获取时间报错

    报错类型:Error 1292: Incorrect datetime value: '0000-00-00' for column 'created_at' at row 1 在添加用户到数据库时, ...

  4. [深度学习] imgaug库使用笔记

    imgaug是一款非常有用的python图像增强库,非常值得推荐应用于深度学习图像增强.其包含许多增强技术,支持图像分类,目标检测,语义分割,热图.关键点检测等一系列任务的图像增强.本文主要介绍img ...

  5. [C++]std::sort()函数使用总结

    函数声明 template< class RandomIt, class Compare > constexpr void sort( RandomIt first, RandomIt l ...

  6. appium如何连接多台设备

    我们在做app自动化的时候,若要考虑兼容性问题,需要跑几台设备,要是一台一台的跑比较耗 时,因此需要考虑使用多线程来同时操作多台设备. 1.我们拿两台设备来模拟操作下,使用:adb devices查看 ...

  7. 图文并茂的学习笔记--微信小程序自定义tabbar

    我发现自带的那个tabbar不可以修改样式,没得搞啊,这不行,要改 首先,我们看文档,地址在下面 https://developers.weixin.qq.com/miniprogram/dev/fr ...

  8. Appium资源汇总

    Appium资源汇总 created: 2022-8-4 软件 网址 说明 https://github.com/appium/appium-inspector/releases 检查器的下载路径 h ...

  9. 使用Addressables.LoadAssetAsync<Asset>(target)加载unity资源,不止是gameobject

    要声明的方法: public static async Task<string> ReadJsonData(string target){  TextAsset jsonDataObjec ...

  10. VM安装Centos 经典安装

    1 VM安装配置 1.1 新建虚拟机 1.2 选择典型 1.3 选择CentOS镜像 链接:https://pan.baidu.com/s/1K2rTjrWY5sgEgx2pU0x-gg 提取码:89 ...