How do I use Stub Status on nginxcp / Nginx Admin?

Somebody asked me how to apply http_stub_status_module for Nginx Admin (or nginxcp).

I’ll answer this briefly but concisely.

Step 1:

SSH to your host.

Okay, done?

cd to the location where you installed Nginx Admin, in my case:

/usr/local/src/publicnginx

Found it? Sweet, let’s move on.

pico /usr/local/src/publicnginx/nginxinstaller

Find line 144. Got it? It looks like this (although not fully):

nginxconfigure = “”” ./configure –with-pcre=%s/pcre-8.30 –sbin-path=/x/sbin –conf-path=/x/nginx/nginx.conf –pid-path=/x/nginx.pid

It’s a bit longer than this. But it doesn’t matter. All you do now is adding the line below to the syntax above:

–with-http_stub_status_module

Save the new file, run it:

./nginxinstaller install

You may have to run the uninstaller first depending on whether you have it installed or not already. In such a case: uninstall, then install again. It merely takes two or three minutes.

OK, fine!

Now we want to add the “location” part for being able to actually monitor the status. We do this in one of the vhosts: I used k0nsl.org

pico /etc/nginx/vhosts/your.vhost

Add this, but modify the request / url part to match whatever you want:

location /k0nsl_status {
stub_status on;
access_log off;
#allow some.ip.here;
#deny all;
}

You’ll want to add this directive in the server part of your vhost alongside with all your other location directives. Simple.

Now save your vhost. Restart nginx (or “nginxcp” via WHM). And voilà ! The http_stub_status_module is now working for your Nginx Admin installation.

Please keep in mind that locations and such could probably be a tad different on your system – but if you installed Nginx Admin there’s a big chance you have a clue about all this. That’s why I kept everything so simple throughout the how-to / response.
All you really need to make this work is very basic knowledge of Linux.

Good bye,
–k0nsl.

Leave a Reply

Your email address will not be published. Required fields are marked *