我的日记 我的日记

记录精彩的程序人生

目录
ubuntu 20.04 自定义编译Nginx问题以及解决方法
/  

ubuntu 20.04 自定义编译Nginx问题以及解决方法

问题1

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

sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev

问题2

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

sudo apt-get install zlib1g-dev

问题3

./configure: error: the HTTP XSLT module requires the libxml2/libxslt libraries

sudo apt-get install libxml2 libxml2-dev libxslt-dev

问题4

./configure: error:the HTTP image filter module requires the GD library.

sudo apt-get install libgd-dev libgd2-xpm-dev

问题5

./configure: error: the GeoIP module requires the GeoIP library.

sudo apt-get install geoip-database libgeoip-dev

问题6

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

sudo apt install build-essential
#如果安装失败切换阿里源
vim /etc/apt/sources.list
#然后写入如下,即可设置阿里源 以下只适合20.04
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
#在执行如下即可安装
sudo apt-get update

提供部分离线包

ubuntu20.04安装nginx常用依赖库.zip

# 文件内容如下
1.gcc_4%3a9.3.0-1ubuntu2_amd64.deb
2.libgd-dev_2.2.5-5.2ubuntu2.1_amd64.deb
3.libpcre3_2%3a8.39-12ubuntu0.1_amd64.deb
4.libpcre3-dev_2%3a8.39-12ubuntu0.1_amd64.deb
5.libssl-dev_1.1.1f-1ubuntu2.19_amd64.deb
6.libx11-6_2%3a1.6.9-2ubuntu1.2_amd64.deb
7.libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.6_amd64.deb
8.libxpm-dev_1%3a3.5.12-1ubuntu0.20.04.1_amd64.deb
9.libxslt1-dev_1.1.34-4ubuntu0.20.04.1_amd64.deb
10.libxt-dev_1%3a1.1.5-1_amd64.deb
11.openssl_1.1.1f-1ubuntu2.19_amd64.deb
12.zlib1g_1%3a1.2.11.dfsg-2ubuntu1.5_amd64.deb


标题:ubuntu 20.04 自定义编译Nginx问题以及解决方法
作者:adongs
地址:https://adongs.com/articles/2023/09/26/1695729541946.html