John Guzman
John Guzman

Reputation: 109

Setting up /status page of php-fpm on Apache2

I'm trying to set up the /status page of php-fpm on apache, but i'm getting a 404 error and i can't know why. I'm not expert at neither Apache2 or php, and i been struggling with this a couple days, so i'm here for some help.

This is my apache2.conf settings. And i also have another site hosted on apache with a Directory config:

<LocationMatch "/fpm-status">
Order Allow,Deny
Allow from 127.0.0.1
ProxyPass unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/fpm-status
</LocationMatch>

This is my php5.6 settings

listen = /run/php/php5.6-fpm.sock
listen.backlog = 65535
user = www-data
group = www-data
pm.status_path = /fpm_status

When i try to curl over http://localhost/fpm-status this message appears:

File not found.

On apache2 logs this appears when i try to acces that path:

AH01071: Got error 'Primary script unknown\n'

Upvotes: 2

Views: 2545

Answers (2)

John Guzman
John Guzman

Reputation: 109

I solved it, I made multiple changes and then it worked, i don't know what certainly was, so i listed them.

  1. Changed "fcgi://localhost/fpm-status" to "fcgi://localhost/"
  2. Changed "pm.status_path = /fpm_status" to "pm.status_path = /status"
  3. service apache2 restart
  4. service php5.6-fpm restart
  5. Then curl to http://localhost/status and worked as expected

Upvotes: 0

Fred
Fred

Reputation: 74

Check this: https://gist.github.com/Jiab77/a9428050ab9bb3f17c5e33343da94fd8

Seems you may be missing an Alias.

Upvotes: 1

Related Questions