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
相关推荐
假如梵高是飞行员1 小时前
WSL2 从 img 镜像文件启动特定 Linux 发行版完整指南
linux·windows·wsl
瓶中怪3 小时前
ROS2 机器人软件系统
linux·c++·python·ubuntu·vmware·ros2·机器人软件开发
iangyu3 小时前
linux配置时间同步
linux·运维·服务器
天空'之城3 小时前
Linux 系统编程 04:进程基础
linux·开发语言·进程基础
从零开始的代码生活_3 小时前
NAT、代理服务与内网穿透详解
linux·服务器·网络·c++·http·智能路由器
灯厂码农4 小时前
C语言内存管理——内存对齐与共用体union
linux·服务器·c语言
charlie1145141914 小时前
Cinux: 加载第一个内核:从 bootloader 跳进 C++
linux·开发语言·c++·嵌入式
iPad协议个微协议4 小时前
企业微信文件上传下载在自动化系统中的处理方式
java·运维·人工智能·机器人·自动化·企业微信
Tian_Hang5 小时前
eclipse ditto 学习笔记
运维·服务器·开发语言·javascript·3d
江畔柳前堤5 小时前
第13章:docker生产环境部署实战
运维·git·docker·容器·代码复审