2010/2/24 Davy Campano <dcampano@gmail.com>:
> Hey Jerome,
> I think he might have been confused because you called it /status but in the
> curl examples you were calling it with status.php.
yes you're right ... In my test env, it's called status.php to avoid
having 2 location in my nginx.conf.
my mistake
>Also, just wanted to
> thank you for your well done examples.
> Thanks
you're welcome
> Davy
> 2010/2/24 Jérôme Loyet <ml@fatbsd.com>
>>
>> as you wish.
>>
>> I recommand not to choose a .php extension in order to NOT confuse
>> with a classic PHP file. This also makes you have two differents conf
>> in your webserver and this is better for security (you can restrict
>> access to the status and ping pages easily).
>>
>> 2010/2/24 任晓磊 <julyclyde@gmail.com>:
>> > status or status.php?
>> >
>> > 2010/2/24 Jérôme Loyet <ml@fatbsd.com>:
>> >> hi,
>> >>
>> >> to request this page, you have to set it up in fpm and configure nginx
>> >> (or another front web server) to access it.
>> >>
>> >> For exemple in php-fpm.conf:
>> >> <value name="status">/status</value> // requesting /status will
>> >> return the status page
>> >> <value name="ping">/ping</value> // requesting /ping will return the
>> >> text set next
>> >> <value name="pong">pong</value> // requestint the previous parameter
>> >> will return pong
>> >>
>> >> And in nginx.conf:
>> >> ...
>> >> http {
>> >> server {
>> >> listen 80;
>> >> ...
>> >> location ~ ^/(status|ping)$ {
>> >> include fastcgi_params;
>> >> fastcgi_pass backend;
>> >> fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
>> >> allow 127.0.0.1;
>> >> allow stats_collector.localdomain;
>> >> allow watchdog.localdomain;
>> >> deny all;
>> >> }
>> >> }
>> >> }
>> >>
>> >> The request the web server:
>> >>
>> >> # curl http://localhost:81/status.php
>> >> accepted conn: 2
>> >> pool: pool_1
>> >> process manager: static
>> >> idle processes: 3
>> >> active processes: 0
>> >> total processes: 3
>> >>
>> >> # curl http://localhost:81/status.php?html
>> >> <table>
>> >> <tr><th>accepted conn</th><td>3</td></tr>
>> >> <tr><th>pool</th><td>pool_1</td></tr>
>> >> <tr><th>process manager</th><td>static</td></tr>
>> >> <tr><th>idle processes</th><td>3</td></tr>
>> >> <tr><th>active processes</th><td>0</td></tr>
>> >> <tr><th>total processes</th><td>3</td></tr>
>> >>
>> >> # curl http://localhost:81/status.php?json
>> >> {"accepted conn":4,"pool":"pool_1","process manager":"static","idle
>> >> processes":3,"active processes":0,"total processes":3}
>> >>
>> >> # curl http://localhost:81/ping.php
>> >> pong
>> >>
>> >> enjoy
>> >>
>> >> 2010/2/23 Davy Campano <dcampano@gmail.com>:
>> >>> The new php-fpm that is built into PHP 5.3 supports a /status command
>> >>> to get
>> >>> information about the pool. I'm wondering if anyone knows if there is
>> >>> an
>> >>> easy way to query this status from a shell script using netcat or
>> >>> something
>> >>> similar? Thanks
>> >>> Davy
>> >>
>> >
>> >
>> >
>> > --
>> > Ren Xiaolei
>> >
>
>