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
相关推荐
cui_ruicheng1 分钟前
Linux信号机制(一):从概念到产生与处理
linux·运维·服务器
zhouwy1131 小时前
Linux文件系统与IO编程
linux·c++
KnowSafe2 小时前
从手动到智能:证书自动化解决方案的技术演进
运维·自动化
xingfujie9 小时前
运维实战攻略
运维
HHFQ9 小时前
在 systemd 场景下的 CPU 限制方式
linux
道清茗9 小时前
【RH294知识点汇总】第 9 章 《 自动执行 Linux 管理任务 》常见问题
linux·运维·服务器
山羊硬件Time9 小时前
自动化管理Linux的好工具:shell script
linux·嵌入式硬件·硬件工程师·基带工程·硬件开发
北方的流星9 小时前
华三路由器NAT配置
运维·网络·华三
wj30558537810 小时前
Codex + Git 开发环境配置指南(WSL版)
linux·运维·git
星马梦缘10 小时前
如何切换window-ubuntu双系统【方案二】
linux·运维·ubuntu