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
相关推荐
Xの哲學6 小时前
Linux grep命令:文本搜索的艺术与科学
linux·服务器·算法·架构·边缘计算
夜月yeyue6 小时前
Linux 调度类(sched_class)
linux·运维·c语言·单片机·性能优化
林义满6 小时前
运维转型让产线 “少掉链”:上海义满汽车零部件借智能运维降本增效,年减损失超 200 万
运维·汽车
VekiSon7 小时前
Linux系统编程——IPC进程间通信:信号通信与共享内存
linux·运维·服务器
南山nash7 小时前
CentOs7 安装 Docker 详细步骤
linux·运维·docker·容器
徐先生 @_@|||7 小时前
Conda最基础使用命令
linux·windows·conda
ZHHHHHJ667 小时前
LL层-PAST
运维·服务器·网络
wdfk_prog8 小时前
[Linux]学习笔记系列 -- [fs][drop_caches]
linux·笔记·学习
咩咩大主教8 小时前
VSCode远程连接Linux部署的Docker
linux·vscode·docker
名誉寒冰8 小时前
GDB 调试与 Core Dump(段错误)排查指南(Linux/C/C++)
linux·c语言·c++