Linux, Windows, Virtualization, OpenSource & Blogging

phpMyAdmin with Nginx on LinuxMint 18 / LinuxMint 17

0

PHPMyAdmin is the web based administration tool for managing the MySQL, MariaDB and Drizzle servers. It helps in performing databases activities such as creating, deleting, querying, tables, columns, relations, indexes, users, permissions, etc. This guide will help you to install phpMyAdmin on Linuxmint 18 / 17.

Before installing phpMyAdmin, you must have LEMP installed on the server.

READ: How to Install Nginx, PHP, and MySQL on LinuxMint 18 / LinuxMint 17

Install phpMyAdmin

I am assuming that you have completed the previous steps. Install phpMyAdmin using the following command.

sudo apt-get install phpmyadmin

Configure phpMyAdmin

phpMyAdmin package does not put any config file for Nginx, and we have to create it as per our requirement. In Nginx, virtual host file can be found in /etc/nginx/conf.d directory. Let’s create a file called “phpmyadmin.conf”

sudo nano /etc/nginx/conf.d/phpMyAdmin.conf

Paste the following content into the file, do modify it as per your requirement.

server {
listen   80;
server_name phpmyadmin.itzgeek.com;
root /usr/share/phpmyadmin;

location / {
index  index.php;
}

## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log        off;
expires           30d;
}

location ~ /\.ht {
deny  all;
}

location ~ /(libraries|setup/frames|setup/libs) {
deny all;
return 404;
}

location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
}
}

Restart the services.

sudo service nginx reload
sudo service php5-fpm reload

Access phpMyAdmin

Now access the phpMyAdmin from the browser, URL will be http://your-fqdn. Login by using root or admin user.

phpMyAdmin with Nginx on LinuxMint 18 - Nginx phpMyadmin Login
phpMyAdmin with Nginx on LinuxMint 18 – Nginx phpMyadmin Login

You will get the database page.

phpMyAdmin with Nginx on LinuxMint 18 - Nginx phpMyadmin Home page
phpMyAdmin with Nginx on LinuxMint 18 – Nginx phpMyadmin Home page

That’s All. Hope this helped you, we welcome your comments.

POSTS YOU MAY LIKE -:)

You might also like

phpMyAdmin with Nginx on LinuxMint 18 / LinuxMint 17

0