phpmyadmin + LEMP Server on Ubuntu 12.04 (Precise Pangolin)

Hello,

I am running a LEMP server on my linode, set up according to the walkthrough ( https://library.linode.com/lemp-guides/ … e-pangolin">https://library.linode.com/lemp-guides/ubuntu-12.04-precise-pangolin )

I currently have several sites running and I want a gui to manage mySQL. I've begun to install phpmyadmin (using https://library.linode.com/databases/my … 04-precise">https://library.linode.com/databases/mysql/phpmyadmin-ubuntu-12.04-precise as a reference). When I run

sudo apt-get install phpmyadmin

I am asked which server to automatically configure phpMyAdmin for but nginx is not an option - my two options are "apache2" and "lightlpd" (I'm thinking I have these installed from some initial tinkering I did while finding a suitable web server configuration.) I am running all of my websites + databases on nginx so I am confused why "nginx" doesn't appear in the phpmyadmin configuration option.

Does anyone have a reliable set of instructions for installing phpmyadmin on a LEMP server that has several active databases?

I definitely don't want to muck up my server or lose database information.

2 Replies

You can just download phpmyadmin from the site, create a vhost for it in nginx manually and upload the files there. There's no need to do it through apt-get.

I'd recommend doing phpmyadmin via apt-get from a security point of view/ease of management. You just need to do the server configuration yourself which is not hard. I'd even do the apache2 configuration myself… Everyone in the world having the default configuration, and therefore default location for phpmyadmin is a bit of a risk.

In nginx it's simple, something like this is a good starting point (from http://magnatecha.com/set-up-phpmyadmin-with-nginx/):

    server {
        listen          81;
        server_name     localhost;
        root        /usr/share/phpmyadmin;
        index       index.php index.html index.htm;
        if (!-e $request_filename) {
            rewrite ^/(.+)$ /index.php?url=$1 last;
            break;
        }
        location ~ .php$ {
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi_params;
        }
    }

Don't just copy and paste that code, I'm assuming you know a little bit about about nginx/php-fpm etc. You'll need to adjust the lines appropriately to your needs and I'd suggest adding additional levels of security (ip address allow/deny at a min).

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct