Comments on Running phpMyAdmin On Nginx (LEMP) On Debian Squeeze/Ubuntu 11.04

Running phpMyAdmin On Nginx (LEMP) On Debian Squeeze/Ubuntu 11.04 The phpMyAdmin package from the Debian/Ubuntu repositories comes with configuration files for Apache and Lighttpd, but not for nginx. This tutorial shows how you can use the Debian Squeeze/Ubuntu 11.04 phpMyAdmin package in an nginx vhost. Nginx is a HTTP server that uses much less resources than Apache and delivers pages a lot of faster, especially static files.

6 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: rautamiekka

Faster and less hungry than Apache, that's a ballsful claim. -Not- like it couldn't be true.

By: JohnP

For any of the webmine/phpadmin/myadmin tools, it is a best practice to limit access by subnet too. These tools shouldn't be available on the public internet to everyone. They are an often-used, successful, attack vector - just last week WineHQ had a breach - http://www.h-online.com/open/news/item/WineHQ-access-credentials-harvested-1359778.html
Nginx can filter based on many things, including source IP.
location /phpmyadmin { .... allow 192.168.0.0/24; # Internal LAN allow 10.10.1.0/24; # Remote WAN using VPN deny all; .... }

Simple. Effective. Public access to all admin tools should be locked down in some way. Nginx has some pretty great ways to accomplish that.

By: SGhosh

Thanks so much for the tutorial. It was precise and perfect. One could blindly follow this! :)

By: amosbatto

In my server running Debian wheezy, I tried using the above instructions and I got errors in the web browser.  In order to get it to work, I used the following vhost configuration which I found at: https://www.howtoforge.com/perfect-server-debian-wheezy-nginx-bind-dovecot-ispconfig-3-p4

          location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass unix:/var/run/php5-fpm.sock;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $request_filename;
                       include /etc/nginx/fastcgi_params;
                       fastcgi_param PATH_INFO $fastcgi_script_name;
                       fastcgi_buffer_size 128k;
                       fastcgi_buffers 256 4k;
                       fastcgi_busy_buffers_size 256k;
                       fastcgi_temp_file_write_size 256k;
                       fastcgi_intercept_errors on;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
      } 

By: Anonymous

thanks a lot you save my life because i use debian 7

By: Gerard

Hi,

I already had nginx with php running and tried to add phpmyadmin using your guide, but on the phpmyadmin page I get:

502 bad gateway

With the following log entry:

2015/04/27 14:19:32 [error] 5209#0: *42 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: 192.168.1.104, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.105", referrer: "http://192.168.1.105/phpmyadmin/"

Do you maybe have a pointer for me why this going wrong?

 

Cheers,

Gerard