nginx put into production, suddenly want to recompile http_stub_status_module module

Background occurred at a time: the company claims, to add some nginx monitoring, including any number of connections and a handshake like, find http_stub_status_module this module should be used to, this way you can crawl through to want to curl ip / nginx_status of data, very convenient.

Here because of security issues, so I shot my own built virtual machine, ready to re-take it again, follow these steps:
1, determine the path your nginx source package installed, I have here is / usr / local / nginx in Source package in / usr / local / src in
nginx put into production, suddenly want to recompile http_stub_status_module module

2, this time to use binary files, as well as the relevant version of the query module,
nginx put into production, suddenly want to recompile http_stub_status_module module

3, below the module to compile stub_status
./configure --prefix = / usr / local / nginx --with-http_stub_status_module

4, Note Note, this time just make the compiler, do not install using make
make

5, this time, objs under this path has been re-created binary file nginx
nginx put into production, suddenly want to recompile http_stub_status_module module
6, make a backup of the original binary file and moved into the new binary file
mv / usr / local / nginx / sbin / nginx / usr / local / nginx / sbin / nginx_backup
mv /usr/local/src/nginx-1.8.1/objs/nginx / usr / local / nginx / sbin
7, this time query file is displayed in Figure ./nginx -V
nginx put into production, suddenly want to recompile http_stub_status_module module

8, nginx.conf edit documents, add content
nginx put into production, suddenly want to recompile http_stub_status_module module
9, using curl -s After starting to grab the data you want
nginx put into production, suddenly want to recompile http_stub_status_module module

Guess you like

Origin blog.51cto.com/12092988/2405041