perusio / drupal-with-nginx

Running Drupal using nginx: an idiosyncratically crafted bleeding edge configuration.
854 stars 246 forks source link

Allow access to fpm-status and apc #202

Closed jgardezi closed 9 years ago

jgardezi commented 9 years ago

Hi,

I am new to nginx and I made perusio drupal 6 working correctly on single php-fm pool using tcp connection on port 127.0.0.1:9000.

After updating file to add my IP address to files php_fpm_status_allowed_hosts.conf and nginx_status_allowed_hosts.conf /nginx_status is working but /fpm-status is giving me Access denied error.

Also I want to add apc status file please advice the configurations for it accordingly.

Kind regards, Javed Gardezi

simonvlc commented 9 years ago

Try this:

    location ~ ^/(status|ping)$ {
      access_log off;
      allow 127.0.0.1;
      deny all;
      include fastcgi_params;
      fastcgi_pass phpcgi;
    }

I'm not totally sure that the include fastcgi_params is needed, but I think it should work at least ;).

jgardezi commented 9 years ago

Hi simonvlc,

Thank you for your response, since I am new to nginx can you please let me know which file I need to update to the following configurations

location ~ ^/(status|ping)$ { access_log off; allow 127.0.0.1; deny all; include fastcgi_params; fastcgi_pass phpcgi; }

Regards, Javed Gardezi

jgardezi commented 9 years ago

Hi,

I am new to this and I can't figure out to put location ~ ^/(status|ping)$ to show /fpm-status. When ever i go to example.com/fpm-status and it give me "Access Denied" error even I have updated php_fpm_status_allowed_hosts.conf to my public ip address.

/nginx_status works fine with my IP address.

Kind regards, Javed Gardezi

perusio commented 9 years ago

The locations for the php-fpm status info are there. You have to enable it on the configuration. There's a php_fpm_status_allowed_hosts.conf file that defines the IPs of the hosts allowed to access the info and a php_fpm_status_vhost.conffile that defines the locations for the status info. It has to be included in the vhost configuration file. The line is there you just have to uncomment it.

jgardezi commented 9 years ago

Hi perusio,

Thank you for your reply.

I have checked my configurations. In nginx.conf file I have uncommented the line php_fpm_status_allowed_hosts.conf and added my IP address. After that in my vhost configuration file (example.com.conf) I have uncommented php_fpm_status_vhost.conf file. Restarted the server visited on example.com//fpm-status and its gives me "Access denied."

Is there any other configurations i need to check or let me know which log file I need to check?

Note: that I have seen under /fpm-status in php_fpm_status_vhost.conf file fastcgi_pass www0; is passed. I have not defined php-fpm name "www0" only php-fpm "www" pool is running. Does this effect the permissions or it is irrelevant?

Cheers, Javed Gardezi