115 private custom you know

115 private custom you know

[Permanent core customer service: 5828 zu 0650] █
permanent customer [core: 4058 zu 3626] █

First, preparation

  1. Installation OpenResty . Details of the official website to download, install documentation

  2. Installation IDEA . At the same time the following plug-ins installed
    • take
    • nginx Support
    • OpenResty Lua Support

Second, create and configure project

      1. Create a file called luademo1 of the Luaproject


      2. Create conf, srccatalog, and add nginx.conf, build.xmland helloworld.luafiles

        • nginx.conffile

          worker_processes  1;
          error_log logs/error.log info; events { worker_connections 1024; } http { default_type application/octet-stream; access_log logs/access.log; lua_package_path 'luademo1/?.lua;;'; server { listen 8080; server_name localhost; default_type text/html; location = /favicon.ico { log_not_found off; access_log off; } location /test { content_by_lua_file luademo1/helloworld.lua; } } } 
        • helloworld.luafile

          local hello = function () ngx.say("Hello world,Lua!") end hello()
        • build.xmlfile

          <?xml version="1.0" encoding="UTF-8"?> <project name="luademo1" default="dist" basedir="."> <description> run pic-server </description> <!-- set global properties for this build --> <property name="openresty-home" location="D:\openresty-1.15.8.2-win64"/> <property name="conf" location="${basedir}/conf"/> <property name="src" location="${basedir}/src"/> <property name="target-conf" location="${openresty-home}/conf"/> <property name="target-src" location="${openresty-home}/${ant.project.name}"/> <echo>######开发版本的ant配置#####</echo> <target name="clean" depends=""> <echo>清理openresty目录${dist}下的conf,logs,janus,januslib</echo> <delete dir="${target-conf}"/> <delete dir="${target-src}"/> <delete> <fileset dir="${openresty-home}/logs" includes="*.log"> </fileset> </delete> </target> <target name="init" depends="clean"> <echo>创建安装目录</echo> <mkdir dir="${target-conf}"/> <mkdir dir="${target-src}"/> </target> <target name="dist" depends="init" description="generate the distribution" > <echo>复制安装文件</echo> <copy todir="${target-conf}"> <fileset dir="${conf}"></fileset> </copy> <copy todir="${target-src}"> <fileset dir="${src}"></fileset> </copy> </target> </project>

          Which build.xmlfiles D:\openresty-1.15.8.2-win64must be replaced with OpenRestythe real installation directory

      3. Configuration nginx server, for IDEAstartupnginx





      4. Configured Ant Buildfor conf, and srcthe files are copied to OpenRestythe specified directory path installation
        • Right build.xmlfile, selectAdd as Ant Build File

        • Click Antin Runthe implementation of some

        AntDependence JDK environment, so what is specified in the project JDK version, where location JDK1.8

        Run again Antin OpenRestyseeing the installation directory of the files have been copied

        • Set to start Nginx Serverto run before Antthe implementation of file copy


      5. Configuration nginx.confhighlighted, File-> Settings-> Editor-> File Types, select Nginx ConfigAdd afternginx*.conf

        Pre-deployment:

Guess you like

Origin www.cnblogs.com/115vip/p/12434235.html