zoukankan      html  css  js  c++  java
  • nginx学习笔记

    我的工作环境是 Debian . 在 Debian 上安装 ngingx 和其他 linux 安装基本相同。

    在配置 hello world 之前,没有头绪,看了很多资料。最后 "https://github.com/jianfengye/MyWorks/blob/master/nginx_module_mytest". 给我了启发。

    注意,ngx_http_mytest_module.c 中是有语法错误的。ngx_http_mytest_module, 应该有个12参数,而例子中只有11个。具体参数是什么,在往上搜就行了。

    1. nginx 默认安装目录是 "/usr/local/nginx".

        我把 nginx 的 tar 源码解压到 "/usr/local/src/nginx-1.4.2"

    2. 修改安装好的 nginx 配置文件 nginx.conf。该文件位于 "/usr/local/nginx/conf/nginx.conf" .

    端口号我设置为8001
    location = /mytest { mytest;
    }

    3. 重新进入到 nginx 源码目录中。重新编译。操作步骤如下:

        ./configure --add-module='你自己的文件目录'

        sudo make

        sudo make install

    4. 进入 nginx 安装目录 /usr/local/nginx/sbin

        sudo ./nginx

    5. 看看结果吧。

        curl http://localhost:8001/mytest

        hello world

  • 相关阅读:
    基于Twisted的简单聊天室
    小学题的python实现
    初识Go(8)
    初识Go(7)
    初识Go(6)
    初识Go(5)
    初识Go(4)
    初识Go(3)
    初识Go(2)
    初识Go(1)
  • 原文地址:https://www.cnblogs.com/kupig/p/4075268.html
Copyright © 2011-2022 走看看