
OpenResty
ckx0709
坚持,麻木的坚持。
展开
-
OpenResty lor框架安装
在github上借鉴一个openresty框架的web框架,借鉴下来学习一下,其他配置也都OK了,但是一直访问不通,看了错误日志: [C]: in function 'require' /home/ckx/lua-lor-example/lor-example/./app/main.lua:1: in function </home/ckx/lua-lor-example/lor-e...原创 2019-07-10 11:42:38 · 410 阅读 · 0 评论 -
module 'resty.http' not found
没有引入第三方模块resty:解决:1、下载第三方模块依赖:https://github.com/ledgetech/lua-resty-http2、将lua-resty-http/lib/resty下的两个文件http.lua和http_headers.lua拷贝到/usr/local/openresty/lualib/resty目录下(目标路径根据 个人安装的o...原创 2019-07-11 14:05:12 · 5095 阅读 · 0 评论 -
OpenResty lua examples - 1输出随机字符串
通过 content_by_lua_file 参数我们可以为openresty nginx 的server中的http请求设置返回值,这样的操作可以使我们的nginx.conf看起来更简洁,代码逻辑机构更符合审美和写作逻辑。这就需要我从零开始认识lua!输出随机字符串:--[[ 输出随机字符串 lua注释,单行采用----]] --接收http请求参数local ar...原创 2019-07-01 11:17:22 · 676 阅读 · 0 评论 -
OpenResty nginx.conf -- lua_code_cache
开发中,如果每修改一次代码都要去重启一次nginx,太影响开发效率,好在nginx.conf提供了lua_code_cache参数,可以对他操作false来关闭缓存,达到不比每次子u该后重启的目的,在nginx.conf server中添加属性:lua_code_cache off;重新加载篇日志文件启动:重启之后有提醒:this will hurt performance...原创 2019-06-30 22:04:51 · 596 阅读 · 0 评论 -
OpenResty helloword - content_by_lua_file
https://blog.youkuaiyun.com/ckx178/article/details/94346654完成OpenResty的安装,并且打印了helloword,不过是在nginx嵌入了lua:worker_processes 1;error_log logs/error.log;events { worker_connections 1024;}http { ...原创 2019-06-30 21:26:25 · 6047 阅读 · 0 评论 -
./configure: error: the HTTP gzip module requires the zlib library.
Ubuntu安装OpenResty配置参数缺少依赖:sudo apt-get install openssl libssl-devsudo apt-get install libpcre3 libpcre3-devsudo apt-get install zlib1g-dev安装依赖,在执行:./configure --prefix=/usr/local/openresty...原创 2019-06-30 18:34:12 · 1760 阅读 · 2 评论 -
Ubuntu 安装 OpenResty
1、创建文件夹并下载安装包:##创建文件夹并进入目录mkdir /opt && cd /opt##下载安装包wget https://openresty.org/download/openresty-1.13.6.2.tar.gz2、安装依赖(这一步曾折磨了我好久)sudo apt-get install gccsudo apt-get install ...原创 2019-06-30 18:29:27 · 1085 阅读 · 0 评论 -
/usr/bin/env: ‘resty’: No such file or directory
openresty 框架 lor 按照官方给的文档安装后无法正常运行lord命令:解决方案:在/usr/bin下建立resty的钦链接:(根据个人安装的目录,这里是openresty的默认安装目录) ln -s /usr/local/openresty/bin/resty /usr/bin/resty检查lord安装:load -v...原创 2019-07-10 16:39:29 · 1135 阅读 · 0 评论 -
openresty luajit 安装
以root身份进入openresty解压包下的/bundel/luaJIT-x.x目录:执行安装:make clean && make && make install安装成功:直接检查安装:luajit-v...原创 2019-07-10 15:15:51 · 571 阅读 · 0 评论 -
no field package.preload['lor.index']
openresty,启动时包该错误,但是lor框架已经安装,并且检查whereis lord验证安装成功,为什么找不到lor.index,再看错误代码:这里看到require引入有问题,也就是luajit有问题,但是luajit我已经安装,并配置环境变量,为什么还是错?期间重启服务器,也是无济于事,于是只有重新安装openresty,再生成makefile时就声名使用luajit编译:...原创 2019-08-05 17:15:51 · 4393 阅读 · 1 评论