자원을 찾기 위해 115 네트워크 디스크

자원을 찾기 위해 115 네트워크 디스크

[영구 핵심 고객 서비스 : 5828 즈 0650] █
영원한 고객 [핵심 : 4058 즈 3626] █

첫째, 준비

  1. 설치 OpenResty . 다운로드 공식 웹 사이트의 세부 사항은, 문서를 설치

  2. 설치 IDEA . 동시에 다음과 같은 플러그인 설치
    • 소요
    • nginx를 지원
    • OpenResty 루아 지원

둘째, 생성 및 구성 프로젝트

      1. 의 luademo1라는 파일 만들기 Lua프로젝트


      2. 작성 conf, src카탈로그 및 추가 nginx.conf, build.xmlhelloworld.lua파일

        • nginx.conf파일

          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.lua파일

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

          <?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>

          어떤 build.xml파일 D:\openresty-1.15.8.2-win64로 교체해야합니다 OpenResty실제 설치 디렉토리

      3. 에 대한 구성의 nginx 서버 IDEA시작nginx





      4. 구성 Ant Build을 위해 conf, 그리고 src파일이 복사됩니다 OpenResty지정된 디렉토리 경로 설치
        • 오른쪽 build.xml파일 선택Add as Ant Build File

        • 클릭 AntRun일부의 구현

        Ant의존 JDK 환경, 프로젝트 JDK 버전, 위치 JDK1.8에 지정된 그래서 뭐

        다시 실행 AntOpenResty파일의 설치 디렉토리를보고는 복사 된

        • 시작 설정 Nginx Server하기 전에 실행 Ant파일 복사의 구현


      5. 구성 nginx.conf파일 -> 설정 -> 편집기 -> 파일, 강조 표시 유형 을 선택 Nginx Config후 추가nginx*.conf

        배포 전 :

추천

출처www.cnblogs.com/115vip/p/12434722.html