Linux学习之Ubuntu 20.04在github下载源码安装Openresty 1.19.3.1

news/2025/3/13 18:17:22/

参考的博文:《在 Ubuntu 上使用源码安装 OpenResty》
《OpenResty 安装安装详解-Ubuntu》
《Linux学习之CentOS 7源码安装openresty》

https://openresty.org/en/download.html是官网下载网址,页面往下拉有下载的链接。
在这里插入图片描述

https://github.com/openresty/openresty是github上的链接。
在这里插入图片描述
可以点击上图中tags进入有不同版本的页面。
在这里插入图片描述

sudo cat /etc/issue可以看到操作系统的版本是Ubuntu 20.04.4 LTSsudo lsb_release -r可以看到版本是20.04sudo uname -r可以看到内核版本是5.5.19sudo make -v可以看到版本是GNU Make 4.2.1
在这里插入图片描述

sudo apt-get install -y libpcre3-dev libssl-dev perl build-essential curl zlib1g-dev libreadline-dev libncurses5-dev libpcre3-dev安装依赖包。
在这里插入图片描述

安装完成之后如下:
在这里插入图片描述

sudo wget https://github.com/openresty/openresty/archive/refs/tags/v1.19.3.1.tar.gz下载源码压缩包。
在这里插入图片描述

sudo mkdir /openrestycode新建一个/openrestycode放置解压出来的源码。
在这里插入图片描述
sudo tar zxf v1.19.3.1.tar.gz -C /openrestycode/把源码解压到/openrestycode里边,然后使用ls -l /openrestycode看一下/openrestycode里边的文件。
在这里插入图片描述

cd /openrestycode/openresty-1.19.3.1/进入到/openrestycode/openresty-1.19.3.1/里边,ls -l看一下当前目录的文件信息。
在这里插入图片描述

sudo make执行。
在这里插入图片描述
发现报错如下:

rm: cannot remove '*.tar.bz2': No such file or directory
./util/mirror-tarballs: line 891: unix2dos: command not found
make: *** [Makefile:4: all] Error 1

在这里插入图片描述

sudo apt-get install dos2unix安装。
在这里插入图片描述

sudo make再次执行,发现又报错:

rm: cannot remove '*.tar.bz2': No such file or directory
unix2dos: converting file README-windows.txt to DOS format...
./util/mirror-tarballs: line 913: hg: command not found
make: *** [Makefile:4: all] Error 1

在这里插入图片描述

sudo apt-get install -y apt-file安装apt-file
在这里插入图片描述

sudo apt-file update更新。
在这里插入图片描述

sudo apt-file search hg输出了Finding relevant cache files to search ...E: The cache is empty. You need to run "apt-file update" first.
在这里插入图片描述

上边使用sudo apt-file search hg解决不了我的问题,我只能使用sed -n '913p' ./util/mirror-tarballs' ./util/mirror-tarballs看一下./util/mirror-tarballs第913行是什么内容,然后把hg clone粘贴到百度上查找一下,结果看到了博文《【ubuntu】hg clone使用》。
在这里插入图片描述

想要使用sudo apt-get install mercurial安装mercurial却又提示E: You don't have enough free space in /var/cache/apt/archives/.
在这里插入图片描述
有看一篇博文《ubuntu “you don‘t have enough free space in /var/cache/apt/archives‘错误解决》,找到一个大型文件删除了。

sudo apt-get install -y mercurial免确认安装mercurial
在这里插入图片描述

安装完成如下:
在这里插入图片描述

cd /openrestycode/openresty-1.19.3.1/进入到源码目录里边,sudo make再次执行编译。
在这里插入图片描述

完成之后如下:
在这里插入图片描述
cd openresty-1.19.3.1/进入到目录。
在这里插入图片描述

sudo ./configure --with-http_gzip_static_module --with-http_v2_module --with-http_stub_status_module --with-luajit --with-http_iconv_module进行配置。
在这里插入图片描述

完成如下如所示:
在这里插入图片描述

sudo make进行编译。
在这里插入图片描述

完成如下图所示:
在这里插入图片描述

sudo make install进行安装。
在这里插入图片描述

安装完成之后如下图:
在这里插入图片描述

此文章为8月Day 25学习笔记,内容来源于极客时间《Linux 实战技能 100 讲》。


http://www.ppmy.cn/news/1061590.html

相关文章

如何在React中进行动画处理和过渡效果实现?列举并简述一下几种常见的动画库和工具。

1、在React中如何进行国际化(i18n)和本地化(l10n)的实现和应用?列举并简述一下几种常见的国际化库和工具。 React中的国际化(i18n)和本地化(l10n)可以通过以下几种方式实现: 使用React-Intl库:React-Intl是一个基于JavaScript的国际化库&…

cuda11.1和cuDNN v8.8.1的安装目录问题

cuda的不同版本文件路径是不一致的,在cuda10.1中,配置cudnn的文件路径是: sudo cp cuda/include/cudnn.h /usr/local/cuda-10.1/include/ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64/但是在cuda11.1中,文件路径…

【业务功能篇83】微服务SpringCloud-ElasticSearch-Kibanan-docke安装-应用层实战

五、ElasticSearch应用 1.ES 的Java API两种方式 Elasticsearch 的API 分为 REST Client API(http请求形式)以及 transportClient API两种。相比来说transportClient API效率更高,transportClient 是通过Elasticsearch内部RPC的形式进行请求…

MyBatis与Spring整合以及AOP和PageHelper分页插件整合

目录 前言 一、MyBatis与Spring整合的好处以及两者之间的关系 1.好处 2.关系 二、MyBatis和Spring集成 1.导入pom.xml 2.编写配置文件 3.利用mybatis逆向工程生成模型层代码 三、常用注解 四、AOP整合pageHelper分页插件 创建一个切面 测试 前言 MyBatis是一个开源的…

论文阅读_模型结构_LoRA

name_en: LoRA: Low-Rank Adaptation of Large Language Models name_ch: LORA:大语言模型的低阶自适应 paper_addr: http://arxiv.org/abs/2106.09685 date_read: 2023-08-17 date_publish: 2021-10-16 tags: [‘深度学习’,‘大模型’] author: Edward J. Hu cita…

人工智能技术的主要类别

人工智能技术主要类别: 机器学习: 监督学习:使用带有标签的训练数据来训练模型,使其能够预测未知数据的标签。常见任务包括分类和回归。无监督学习:使用无标签的训练数据,模型通过发现数据中的模式、聚类或…

【洛谷】P2440 木材加工

原题链接:https://www.luogu.com.cn/problem/P2440 1. 题目描述 2. 思路分析 整体思路:二分答案 设置一个变量longest来记录最长木头的长度,sum记录切成的小段数量之和。 令左边界l0,右边界llongest。 写一个bool类型的check…

solidity0.8.0的应用案例12:通用可升级合约UUPS

代理合约中选择器冲突(Selector Clash)的另一个解决办法:通用可升级代理(UUPS,universal upgradeable proxy standard)。代码由OpenZeppelin的UUPSUpgradeable简化而成,不应用于生产。 UUPS 作为透明代理的替代方案,UUPS也能解决"选择器冲突"(Selector Cl…