openresty安装配置,执行shell脚本

  1. 下载并解压 OpenResty 源代码:

    复制代码

    bashCopy code

    wget https://openresty.org/download/openresty-1.19.9.1.tar.gz tar -zxvf openresty-1.19.9.1.tar.gz cd openresty-1.19.9.1

  2. 运行 ./configure 并指定安装路径:

    复制代码

    bashCopy code

    ./configure --prefix=/usr/app/openresty

  3. 编译并安装:

    复制代码

    bashCopy code

    make sudo make install

  4. 验证安装:

    复制代码

    bashCopy code

    /usr/app/openresty/nginx/sbin/nginx -v

  5. 启动 OpenResty:

    复制代码

    bashCopy code

    /usr/app/openresty/nginx/sbin/nginx

请根据实际需要调整路径和权限。确保在使用 make install 时有足够的权限来写入目标目录。

创建一个ftpfile.lua脚本

复制代码

-- 执行压缩文件存入数据库脚本

--io.stdout:setvbuf("no")

--io.stdout:setmode("noconvert")

ngx.say("Executing Lua script!")

--os.execute("export PATH=$PATH:/usr/bin")

os.execute("/usr/app/openresty/lua/ftpfile.sh")

保存。配置nginx .

复制代码

location /ftpfile {

default_type 'text/plain';

content_by_lua_file /usr/app/openresty/lua/ftpfile.lua;

}

启动浏览器访问。就执行lua脚本

相关推荐
landonVM2 天前
OpenResty 的性能优化配置建议
性能优化·openresty
我发在否11 天前
OpenResty > Lua断点调试
vscode·lua·断点·openresty·luapanda
oMcLin17 天前
如何在 CentOS 7 上通过配置和调优 OpenResty,提升高并发 Web 应用的 API 请求处理能力?
前端·centos·openresty
笑笑�23 天前
OpenResty + nginx_upstream_check_module 构建主动健康检查模块
运维·nginx·负载均衡·openresty
Wang's Blog1 个月前
Lua: Web应用开发之OpenResty与Lapis框架深度指南
lua·openresty
驯龙高手_追风1 个月前
OpenResty+NtripCaster实现挂载点负载均衡使用初探
junit·负载均衡·openresty
秃了也弱了。1 个月前
OpenResty+redis实现基于ip的代理层灰度发布
redis·tcp/ip·openresty
Energet!c1 个月前
Nginx access 日志通过 Filebeat 8.15.5 写入 Elasticsearch 8 实战指南
nginx·elasticsearch·filebeat·openresty
联系QQ 180809511 个月前
汽车变速器电控系统Simulink模型:从原理到实现
openresty
根哥的博客2 个月前
编译nginx-1.28.0支持lua语法
nginx·lua·openresty·nosql注入漏洞