• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)

By Abhishek Ghosh March 22, 2015 10:47 am Updated on March 22, 2015

Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)

Advertisement

Here is How To Enable Nginx PHP-FPM Status Page on Ubuntu Server Instance Running on HP Cloud. Enabling Ping Has Difference With Enabling Status. We have discussed in details about how to enable ping on Nginx with PHP-FPM running on Ubuntu server instance on HP Cloud. That Guide is Mandatory to Read Before Reading This Guide on How To Enable Nginx PHP-FPM Status Page.

 

Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud) : Security Matters

 

Unless you have good grasp on Router, Subnet and Firewall in general, you possibly should not approach to enable Nginx PHP-FPM status page.

We basically do not need the status to be opened to the whole World. So, Ping should be configured separately from the Status Page, so that the others can not access this webpage. Most of the guide websites will misdirect and mess up the things to one single guide. That is what is not exactly the right idea.

Advertisement

---

 

Steps To Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)

 

Again, you must read the guide on how to enable ping on Nginx with PHP-FPM running on Ubuntu server instance on HP Cloud. We are taking that, you have enabled Ping from the previous guide.

For a standard PHP5 FPM-Ngnix setup, we need to configure two files for a right Ping response. You need to uncomment ( remove ;) from the /etc/php5/fpm/pool.d/www.conf file :

Vim
1
pm.status_path = /status

The documention written on that file is like this :

/etc/php5/fpm/pool.d/www.conf
Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
;   http://www.foo.bar/status
;   http://www.foo.bar/status?json
;   http://www.foo.bar/status?html
;   http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
;   http://www.foo.bar/status?full
;   http://www.foo.bar/status?json&full
;   http://www.foo.bar/status?html&full
;   http://www.foo.bar/status?xml&full
; The Full status returns for each process:
;   pid                  - the PID of the process;
;   state                - the state of the process (Idle, Running, ...);
;   start time           - the date and time the process has started;
;   start since          - the number of seconds since the process has started;
;   requests             - the number of requests the process has served;
;   request duration     - the duration in µs of the requests;
;   request method       - the request method (GET, POST, ...);
;   request URI          - the request URI with the query string;
;   content length       - the content length of the request (only with POST);
;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
;   script               - the main script called (or '-' if not set);
;   last request cpu     - the %cpu the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because CPU calculation is done when the request
;                          processing has terminated;
;   last request memory  - the max amount of memory the last request consumed
;                          it's always 0 if the process is not in Idle state
;                          because memory calculation is done when the request
;                          processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
;   ************************
;   pid:                  31330
;   state:                Running
;   start time:           01/Jul/2011:17:53:49 +0200
;   start since:          63087
;   requests:             12808
;   request duration:     1250261
;   request method:       GET
;   request URI:          /test_mem.php?N=10000
;   content length:       0
;   user:                 -
;   script:               /home/fat/web/docs/php/test_mem.php
;   last request cpu:     0.00
;   last request memory:  0
;
; Note: There is a real-time FPM status monitoring sample web page available
;       It's available in: ${prefix}/share/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
;       anything, but it may not be a good idea to use the .php extension or it
;       may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status

Others should never able to view the output. Ping, on the other hand is a Open Matter. So, we need to enable status separately from that of Ping. Opening status widely will invite more trouble. In the Nginx Site specific file (/etc/nginx/sites-available/default) :

/etc/nginx/sites-available/default
Vim
1
2
3
4
5
6
7
8
9
10
11
location /status {
     access_log off;
     allow 127.0.0.1;
# allow sub.net.ip;
     deny all;
       fastcgi_split_path_info ^(.+.php)(.*)$;
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
}

Now restart the services :

Vim
1
2
service php5-fpm restart
service nginx -t && service nginx restart

We are using UNIX socket. If you have not configured UNIX socket and using TCP/IP, you should pass :

/etc/nginx/sites-available/default
Vim
1
fastcgi_pass 127.0.0.1:9000;

instead of

/etc/nginx/sites-available/default
Vim
1
fastcgi_pass unix:/var/run/php5-fpm.sock;

Now, if we do SSH and do cURL or wget :

Vim
1
2
3
4
# for HTTPS
curl -k https://127.0.0.1/status
# for non HTTPS
curl -k http://127.0.0.1/status

You should be able to view the response :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pool:                 www
process manager:      dynamic
start time:           22/Mar/2015:10:02:29 +0000
start since:          145
accepted conn:        42
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       2
active processes:     1
total processes:      3
max active processes: 2
max children reached: 0
slow requests:        0

Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)

Obviously, if you want to do the request from 10.0.0.30 subnet then :

/etc/nginx/sites-available/default
Vim
1
2
3
4
5
6
7
8
9
10
11
location /status {
     access_log off;
     allow 127.0.0.1;
allow 10.0.0.30;
     deny all;
       fastcgi_split_path_info ^(.+.php)(.*)$;
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
}

Because, with the JSON, we can create graph. You can do the same cURL with domain name or from your local computer, you’ll 403 Forbidden response :

Vim
1
2
3
4
5
6
7
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>

We exactly wanted this setup for security. I will not have this 403 Forbidden for Ping :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
âžœ  Desktop  curl -I https://thecustomizewindows.com/ping
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 22 Mar 2015 10:08:50 GMT
Content-Type: text/plain
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.5.9-1ubuntu4.6
Expires: Sat, 16 Jan 2016 10:08:50 GMT
Cache-Control: max-age=25920000
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Public-Key-Pins: pin-sha256="cTvjlwJ90gznKckrq+Le+9w5ncyKFwzLJOkgMBNoX2M="; max-age=5184000; includeSubDomains
Cache-Control: Public
Alternate-Protocol: 443:npn-spdy/3
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

You’ll understand the security flaws of making these settings usable on non-Enterprise grade webhost. If these were safer for ordinary hosts, both PHP-FPM and Nginx would add them by default. The guide followers will complain of errors as the main physical router will slowly block the IPs. That will never happen with HP Cloud.

If with ordinary host, you can check the status with domain name – know it clearly – your DNS servers are sub optimally configured or Ingress and Egress policies are widely opened and you can be a victim of MITMA. Status is more dangerous than Ping. We have that Router, that will help us to control some attacks by default. With Nginx, we added only a slight protection – it is not fully safe if the server is compromised.

Now, we can create a realtime graph in a physically existing location and access it via browser with credentials.

Tagged With <center><h1>403 Forbidden</h1></center> , <html> <head><title>403 Forbidden</title></head> <body bgcolor=white> <center><h1>403 Forbidden</h1></center> <hr><center>nginx</center> </body> </html> , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1822 D8dQHoOdNT0VCK3rzBIoePJQefk5DNpSJbPCjIhfyNDKfmqqh2zeZDqvz8JWf433 f7ff05392fbbee0a83dea5eb7c58435835efb32e&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1826 hz7J2a-OII1xGjXXKQsVk792LdoutzqkG3tB3VYeON80ZKuatBjGChE0ivFg8wrp b72794cdd71bd3cbd650015c94f677e1261028ef&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1835 XCGmDqCfGp4Qj20uGtgTNa7Phe5dtHC-03KstyTVO3npSY5OlETbAYrvAYIq2MVv b2bc068566cea0ad9111a93420fc0fb85f4c3095&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1888 M_9kQNMq0z_-zOUH7VP6PId3a2SoLRqDZnunBJOEoVkg3u5Nz2ofBy95IQArk7dv f8a7f8dc100a0762d8326528b6138d8f32716df6&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme , php-fpm status , php-fpm status page , tarup fpm h1

This Article Has Been Shared 507 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)

  • HHVM WordPress (Nginx Ubuntu Server) Tweaks

    Here are some special HHVM Wordpress (Nginx Ubuntu Server) Tweaks for Page Speed optimization, Compatibility of WordPress Themes and Plugins.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • Zend Opcache Optimization for Nginx Ubuntu (HP Cloud)

    Here is Full Guide to Zend Opcache Optimization for Nginx PHP5-FPM for Ubuntu Server Running on HP Cloud. We Suggest to Use Zend Opcache over APC.

  • SaaS : Everything You Wanted To Know

    SaaS or Software as a Service is designed by the architecture to be used by the consumer. SaaS is the model oCloud which the general users mostly know to exist.

  • Cloud Computing Grown as There Was Real Demand From The Customers

    Cloud Computing grown as there was a clear cut demand from the consumer. Most users who cares for quality, actually went mad with the traditional web hosts. The crap graphics of cPanel, increasing bill for Virtual Private Server and Dedicated server, “your problem you will solve” type of mentality, usage of worst possible hardwares, all […]

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023
  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Enable Nginx PHP-FPM Status Page (Ubuntu, HP Cloud)," in The Customize Windows, March 22, 2015, March 29, 2023, https://thecustomizewindows.com/2015/03/enable-nginx-php-fpm-status-page-ubuntu-hp-cloud/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT