I downloaded the Nginx source version is not tested, by date is - years 7 the latest version of the month. Unpack the package to get the source folder, go to the root directory to find a few subdirectories: Auto , conf , Contrib , Docs , Misc , src . Literally guessing, is automata or scripts ( Auto Script ), Configuration files ( Configuration ), supporting files ( Contributions ), Documents ( Document ), Miscellaneous ( Miscellaneous ), Source ( Source Code ).
1. Browse source folder root directory
As a rule, I choose to look at the document first, but the doc subdirectory does not have detailed offline documentation, only the links to the Nginx website and some small files that cannot be read.
Miscellaneous Misc only a gnumakefile and a README file that you don't understand .
The contrib subdirectory has a geo2nginx.pl(Geo module CSV Database format Conversion perl script), a set of encoding conversion files (including two encoding maps and a code conversion perl script), and vim the nginx Special syntax highlighting configuration file.
the Conf subdirectory has several encoding mappings, variable mapping tables, and a server configuration file.
There are many scripts in the Auto subdirectory that include the server installation script, and now it's hard to see the script, so it's just a simple glance. We found nginx to support many major operating system platforms: Apple's Open source system , Darwin, and the important Unix Branch FreeBSD,linux, and most versions of another Unix branch of the open source Solaris , the highest user share Win32 .
SRC subdirectory is really a need to study the nginx C Source, below we will explore.
2. Browse src sub-directory
or see what subdirectories are in the SRC subdirectory:core,event,http, Mail , Misc , MySQL , OS , Stream . Let's take a literal guess: the core (main function, data structure, Main method), event (event handling mechanism), Hypertext Transfer Protocol (http - related), mail (mail-related), miscellaneous (Google Perftools related source),mysql database, operating system (Unix and Win32 Two types of system system call program source code), stream (meaning unknown). Looks like . The/src/core subdirectory is a good start for researching the source code.
Figure 2 nginx source file structure diagram
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the Nginx source file structure browsing, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.