Working with adminer.php on Hypernode

in Tools

Adminer is a well-known, frequently used replacement for phpMyAdmin. It’s compiled into a single PHP script, which makes it very portable and extremely easy to install.
To install on Hypernodes, we advice to use some additional configuration, that denies all IP’s that are not defined in the whitelist.

Install Adminer

mkdir /data/web/public/adminer
wget -O /data/web/public/adminer/index.php http://www.adminer.org/latest.php

Configure Adminer

Configure a whitelist include file

For this instruction, we need an Includable whitelist to include in our custom snippet. If you haven’t created one, do this first.

Nginx config for Adminer

After we created the whitelist, copy the following Nginx configuration and store it as /data/web/nginx/server.adminer:

## Block phpMyAdmin (We only need Adminer)
location ~* phpmyadmin {
    deny all;
}

## Allow Adminer from known IP's
location ~* /adminer {
    # Only allow IP addresses defined in /data/web/include.whitelist
    include /etc/nginx/app/include.whitelist;

    # Uncomment to secure phpMyAdmin with additional basic_auth 
    # include /etc/nginx/app/include.basic_auth;

    try_files $uri $uri/ /adminer/index.php;

    location ~ \.php$ {
        echo_exec @phpfpm;
    }
}

0