zoukankan      html  css  js  c++  java
  • 使用ZeroBrane Studio调试Openresty lua脚本

    介绍

    ZeroBraneStudio 作为轻量级、跨平台的Lua IDE,已被广泛用来调试各种Lua引擎游戏框架、Openresty、Wireshark脚本等等。

    Openresty 是一个建立在Nginx Web应用服务器,一个非常快的Web服务器,提供非阻塞IO(各种后端redis、memcached、MySQL、HTTP服务器等)和支持Lua作为其脚本语言。


    目的

    本文旨在帮助初涉Openresty开发的相关开发人员了解如何使用ZeroBraneStudio开发和调试自己的lua脚步

    如下按照2个步骤说明:

    1、安装Openresty和ZeroBrane Studio

    2、编写简单Openresty脚步并进行调试


    安装Openresty和ZeroBrane Studio

    1、Openresty安装

    Openresty提供多种安装方式(http://openresty.org/cn/installation.html),在unix系统上我们可以直接使用官方提供的预编译包直接安装,使用windows的同学可以直接下载exe运行(http://openresty.org/cn/download.html)。

    2、ZeroBraneStudio安装

    从https://github.com/pkulchenko/ZeroBraneStudio/releases下载发布包并解压,运行zbstudio.exe or zbstudio.sh打开ZeroBraneStudio,同时点击Project->Project Directory选择Openresty目录。


    编写简单Openresty脚步并进行调试

    我们首先更改openresty配置如下:

    worker_processes  auto;
    
    worker_rlimit_nofile 65535;
    
    events {
        worker_connections 20480;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        limit_req_zone $binary_remote_addr zone=one:50m rate=20r/s;
    
        lua_package_path 'D:eroBraneStudio-1.70/lualibs/?/?.lua;D:eroBraneStudio-1.70/lualibs/?.lua;;';
        lua_package_cpath 'D:eroBraneStudio-1.70/bin/clibs/?.dll;;';
        
        include server.conf;
    }
    
        server {
            listen 80;
    
    
            location /helloworld {
                default_type text/plain;
                content_by_lua_file D:openresty-1.13.6.1-win32luacontent.lua;
            }
        }

    然后运行nginx.exe启动Openresty,点击Project | Start Debugger Server启动Debugger Server,在浏览器输入http://localhost/helloworld,然后即可进入断点调试

    (If you are running on OSX, replace ?.dll with ?.dylib and if you are running on Linux, replace bin/clibs/?.dll with either bin/linux/x86/clibs/?.so or bin/linux/x64/clibs/?.so depending on your platform.)

  • 相关阅读:
    JQuery脚本-通过禁用按钮防止表单重复提交
    获得图片的圆形头像效果
    jquery通过submit()和serialize()提交表单
    nginx location 配置阐述优先级别使用说明
    友盟(Swift)-集成、统计用户数量、具体页面访问数量、具体按钮点击数量
    点击按钮,使按钮进行左右翻转动画
    清除指定区域
    语音播报-文字转系统声音
    颜色线性渐变-CAGradientLayer
    popover带箭头弹框
  • 原文地址:https://www.cnblogs.com/caozhiyuan/p/9425088.html
Copyright © 2011-2022 走看看