Nginx Compilation and debugging

Source: Internet
Author: User

    1. Nginx source compiled, dependent on Pcre and zlib

    2. After downloading the source code, through the./configure--help can view the compilation options, in order to increase the GDB debugging information, using the./configure--with-cc-opt= '-g-o0 ' and make cflags= "-g-o0"

    3. To facilitate debugging, you can start a worker process

    4. Nginx also has support for GDB, with debug_points configuration items: Stop or abort, indicating that when a serious error is encountered,

      The NGINGX process can stop living. If it is abort, you can set the build core file.

    5. With respect to macros, macros are replaced directly by default, and if you change the-G to--ggdb3 at compile time, you can keep the macros, but the executable binaries are increased. Info Macro Ngx_ok/macro expand ngx_ok/p ngx_ok. If info is not found, you can load the list file and then execute the info command.

    6. When compiling, you can add--with-debug to generate debug information.

    7. Error log for configuration file: Error-log logs/error.log debug_http or other parameters, just print what you want.

    8. Strace/pstack:strace-t-t-o-f-p shows the process call; Pstack displays the call stack.

    9. All-in-one access to Nginx execution process: System tap;-finstrument-functions addr2line.sh;

    10. Add pile debugging, embed your own pile function in the code to debug.

    11. Write your own code, encapsulate HTTP messages, construct nginx anomaly scenes to observe.

Nginx Compilation and debugging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.