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 '[email protected]/@/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
相关推荐
草上爬11 分钟前
OpenWrt:使用ALSA实现边录边播
ubuntu·openwrt·record·alsa·play
Kookoos1 小时前
Dynamics 365 Finance + Power Automate 自动化凭证审核
运维·自动化·dynamics 365·power automate
apocelipes4 小时前
Linux c 运行时获取动态库所在路径
linux·c语言·linux编程
努力学习的小廉5 小时前
深入了解linux系统—— 进程池
linux·运维·服务器
秃头菜狗5 小时前
各个主要目录的功能 / Linux 常见指令
linux·运维·服务器
2301_793102495 小时前
Linux——MySql数据库
linux·数据库
jiunian_cn6 小时前
【Linux】centos软件安装
linux·运维·centos
藥瓿亭7 小时前
K8S认证|CKS题库+答案| 6. 创建 Secret
运维·ubuntu·docker·云原生·容器·kubernetes·cks
程序员JerrySUN7 小时前
[特殊字符] 深入理解 Linux 内核进程管理:架构、核心函数与调度机制
java·linux·架构
孤寂大仙v7 小时前
【计算机网络】非阻塞IO——select实现多路转接
linux·计算机网络