docker-ubuntu-24.04安装openresty1.21.4.3全过程

拉取最新的ubuntu镜像

bash 复制代码
docker pull ubuntu:latest

创建启动容器

bash 复制代码
docker run -it --name 容器名称 -p 8082:8082 镜像id /bin/bash

更换apt-get为阿里云镜像

bash 复制代码
sed -i 's@archive.ubuntu.com/@/mirrors.aliyun.com/@g' /etc/apt/sources.list && apt-get update

创建目录

bash 复制代码
cd home
mkdir openresty
cd openresty/

安装依赖库

bash 复制代码
apt-get install wget

apt-get install gcc
apt-get install openssl libssl-dev
apt-get install libpcre3 libpcre3-dev
apt-get install perl make build-essential curl

下载和解压

bash 复制代码
wget https://openresty.org/download/openresty-1.21.4.3.tar.gz
tar -xzvf openresty-1.21.4.3.tar.gz

编译安装

bash 复制代码
./configure --prefix=/usr/local/openresty -j4 --with-luajit
gmake
gmake install

设置环境变量

bash 复制代码
vi /etc/profile
export NGINX_HOME=/usr/local/openresty/nginx
export PATH=${NGINX_HOME}/sbin:$PATH
#保存退出
source /etc/profile

安装luarocks

bash 复制代码
wget https://luarocks.org/releases/luarocks-3.11.0.tar.gz

tar zxpf luarocks-3.11.0.tar.gz

cd luarocks-3.11.0

./configure --prefix=/usr/local/openresty/luajit --with-lua=/usr/local/openresty/luajit/     --lua-suffix=jit --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1

make 

make install

vi /etc/profile
#增加
export PATH=$PATH:/usr/local/openresty/luajit/bin

source /etc/profile
相关推荐
Kurisu_红莉栖5 小时前
关于docker的使用心得
运维·docker·容器
三言老师5 小时前
Rocky Linux 8.6 整机系统备份与迁移方案文档文档用途
linux·运维·服务器·网络
「PlanA」6 小时前
自动化流水线CSDN自动发布文章
运维·自动化
雾时之林6 小时前
Linux----防火墙
linux·运维·网络
海兰6 小时前
【开源工具】BlueKing Lite —— AI 原生的轻量运维平台(二)
运维·人工智能·开源
我星期八休息7 小时前
网络编程—NAT、代理服务与内网穿透
linux·服务器·网络·网络协议
RisunJan8 小时前
Linux命令-sysctl(运行时修改内核参数)
linux·网络·智能路由器
yunwei378 小时前
eBPF 教程:使用 fsession 追踪慢速 vfs_read 调用
linux·云原生
A_humble_scholar8 小时前
Linux 网络基础(三)下的 HTTP 核心详解:从请求响应到状态管
linux·网络·http
Albart5758 小时前
Docker Desktop最新版安装踩坑全记录(Windows_Mac_Linux)【2026 4.74.0 终版】
linux·windows·macos·docker·环境搭建·踩坑记录