Nginx-1. Introduction Getting started

The time to buy a geek Tao-hui's 100 Nginx core knowledge say, is learning. link

Component of Nginx 4

  1. Binary executable file
  2. nginx.conf profile
  3. access.log
  4. error.log

nginx version

  1. Mainline trunk version. Odd version number, features and more, but not necessarily stable.
  2. Stable stable version. The version number even,

Open source version: nginx.org

Business Edition: nginx.com

OpenResty: Nginx + Built-in Lua libraries + + Most third-party module dependencies

Compile your own nginx, because the module requirements are different.

  1. Download nginx

    nginx/download

  2. Description of each directory

    auto major three subdirectories. cc for compilation. lib contains libraries. Analyzing os operating system dependent. When other auxiliary nginx config script execution judgment which modules support, which can be used.

    changes change log. changes .ru Russian version.

    conf, sample configuration file, you can copy the time to go to the installation directory.

    configure file used to generate an intermediate file, perform the necessary actions for compilation.

    contrib. The inside of vim to copy the contents of the folder ~ / .vim directory, edit conf file there to make indentation, font formats.

    man file is the Help file, it is estimated that manual means. There are a nginx.8 file is a manual file, open with a man nginx.8.

    src the source code.

  3. Configure (linux convention)

    ./Configure --help |. More parameters in three categories.

    1. Specifies the number of paths, such as path, etc. log in.
    2. Which modules to use or not use.
    3. Special parameters compile time
    4. It may be less configure when pure-develand zlib-develby what can install yum
    5. ./configure --prefix = / home / nginx / nginx will write binary files, when the hot deployment needs to be consistent.
  4. Intermediate file description

    After completion configure file generated in objs. Focus is nix_modules.c file, which has ngx_modules array containing all the modules. There nginx binary files.

  5. Compile

    make compilation. Generated in objs.

  6. installation

    make install. install to configure the directory above.

Guess you like

Origin www.cnblogs.com/sheldon-lou/p/12355164.html