Setting Phpmyadmin Di Nginx Debian 9
Introduction
Nginx is a popular web server created for Unix-like operating systems like Debian. It is used for many web-related activities such as serving up webpages, hosting web applications, providing authentication and security, and acting as a reverse proxy for webapplications. One popular application for use with Nginx is phpMyAdmin, an administrative Web interface to manage MySQL databases. This article will show you how to install and configure phpMyAdmin on a Debian 9 system with Nginx.
Prerequisites
Before you can install and use phpMyAdmin, you must have an Nginx web server configured and running on Debian 9. If you don’t have Nginx installed already, please refer to our guide on How to install and configure Nginx on Debian 9 for instructions.
In addition, you’ll need to have a MySQL or MariaDB database server installed and running. If you don’t have a database server setup, please refer to our guide on How to install and configure MySQL on Debian 9 for instructions.
Install Phpmyadmin
The phpMyAdmin package is available in the official Debian repositories. To install it, log in to your server as the root user, and then issue the following apt command.
# apt-get install phpmyadmin
When prompted, select “apache2” as the server that should be automatically configured to run phpMyAdmin. Select “yes” for the dbconfig-common package configuration.
You will be prompted to enter an administrative password for the database that will be used by phpMyAdmin to store its information. Enter a secure password and press enter or tab key to proceed to the next step.
Once the installation is complete, you need to make some adjustments to the configuration files to get phpMyAdmin to work correctly.
Configure phpMyAdmin with Nginx
Once phpMyAdmin is installed, you’ll need to configure it for use with Nginx. Begin by creating a new Nginx configuration file for phpMyAdmin.
# nano /etc/nginx/sites-available/phpmyadmin.example.com
Next, add the following content to the newly created file.
[server]
server_name phpmyadmin.example.com;
root /usr/share/phpmyadmin;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
]
Save the file and exit the text editor. To enabled the newly created configuration file, issue the following command.
# ln -s /etc/nginx/sites-available/phpmyadmin.example.com /etc/nginx/sites-enabled/
Now, you’ll need to create a self-signed SSL certificate for your domain.
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt
Next, configure Nginx to use the newly created certificate.
# nano /etc/nginx/sites-available/phpmyadmin.example.com
Add the following content to the file.
server {
listen 443 ssl;
server_name phpmyadmin.example.com;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
root /usr/share/phpmyadmin;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}]
Save the file and exit the text editor. Then, check if the syntax of your configuration is correct. To do that, issue the following command.
# nginx -t
If the command returns no errors, restart the Nginx service to apply the changes.
# systemctl restart nginx
Configure and test Phpmyadmin
Now that phpMyAdmin is configured, we need to create the configuration file to make it accessible from the web. To do that, create a new phpMyAdmin configuration file with the following command.
# nano /usr/share/phpmyadmin/config.inc.php
Add the following content to the file.
$cfg['blowfish_secret'] = 'sEyjfX#{9HYmZq*8^a';
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['allow_no_password'] = true;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
Save the file and exit the text editor. Now, you can access phpMyAdmin by browsing to https://phpmyadmin.example.com you should be greeted by the phpMyAdmin login page.
Conclusion
Now you have a working phpMyAdmin installation running on your Debian 9 system with Nginx. You can use phpMyAdmin to manage your MySQL or MariaDB databases. There are more options available for configuring phpMyAdmin; please refer to the official phpMyAdmin documentation for a more in-depth guide.
FAQs
- Q: What is required to install phpMyAdmin on Debian 9 with Nginx?
- A: You must have an Nginx web server and a MySQL or MariaDB database server installed and running on your system.
- Q: How do I access phpMyAdmin from the web?
- A: You can access phpMyAdmin by browsing to https://phpmyadmin.example.com.
Thank you for reading this article. Please feel free to read other articles on our website to learn more about setting up Nginx and other web services on your Debian 9 system.
Related Posts:
- Install Nginx 1.16 Ubuntu Install Nginx 1.16 Ubuntu Introduction to Nginx 1.16 Nginx 1.16 is a web server that helps you to serve web content quickly, efficiently and securely. It is especially popular with…
- How To Configure Websocket Nginx Fpm How To Configure Websocket Nginx Fpm Introduction Websocket is a modern web technology that provides bidirectional communication between a web server and a web client. The websocket protocol allows for…
- Install Phpmyadmin Ubuntu 18.04 Nginx Install PhpMyAdmin Ubuntu 18.04 Nginx What is PhpMyAdmin? PhpMyAdmin is an open source software written in PHP that provides a graphical web-based interface for accessing and managing your MySQL or…
- Install Pdo_Mysql Ubuntu Nginx Install Pdo_Mysql Ubuntu Nginx What is Pdo_Mysql? PDO_Mysql is a driver for the PHP Data Objects (PDO) extension that provides a database abstraction layer for working with MySQL databases.PDO_Mysql provides…
- Nginx Mariadb Phpmyadmin Php5-Fpm Debian Jessie Nginx Mariadb Phpmyadmin Php5-Fpm Debian Jessie Configuring Nginx on Debian Jessie Nginx is a web server that is used to serve both static and dynamic content to web clients. Installing…
- Linux Nginx Mysql Php Lemp Linux Nginx Mysql Php Lemp What is Linux, Nginx, MySQL, PHP (LEMP)? Linux, Nginx, MySQL, PHP (LEMP) is a software stack combination of Linux, Nginx, MySQL, and PHP, commonly referred…
- Multi Host In Nginx Debian 9 Multi Host In Nginx Debian 9 Introduction Nginx is a web server that can be used for hosting multiple websites on a single server. This guide will help you set…
- Cara Install Phpmyadmin Di Nginx Windows Cara Install Phpmyadmin Di Nginx Windows Instalasi Nginx Nginx adalah salah satu aplikasi web server yang populer dan banyak digunakan di sistem operasi Windows. Untuk menginstal Nginx di Windows, Anda…
- Instal Nginx Centos Di Webuzo Instal Nginx Centos Di Webuzo Background Webuzo is a leading web server platform used by individuals and businesses alike. It supports a range of operating systems, including the popular CentOS…
- Deploy Laravel In Local Nginx Windows Deploy Laravel In Local Nginx Windows 1. Introduction To Nginx Nginx is a web server that is primarily used to handle web traffic. It is open source, meaning it is…
- Setting Php Nginx Ubuntu Vps Setting Up a PHP, Nginx, and Ubuntu VPS What is a VPS? A Virtual Private Server (VPS) is a type of virtualized hosting. It works in the same way as…
- Install Webmin Plugin Nginx Ubuntu Install Webmin Plugin Nginx Ubuntu What is Nginx? Nginx is a web server that runs on the Linux operating system. It is a popular web server software and can handle…
- Reverse Proxy Firewall Nginx Debian Tutorial Reverse Proxy Firewall Nginx Debian Tutorial Introduction to Reverse Proxying with Nginx, Debian & Firewall Reverse proxying is an important technology in distributed systems. By creating a reverse proxy server,…
- Docker Install Nginx Mysql Php Docker Install Nginx Mysql Php What is Docker? Docker is an open-source platform for automating the deployment of applications as lightweight, portable, and self-sufficient containers. It bundles applications and all…
- Membuat Webserver Nginx Php-Fpm Mariadb Phpmyadmin… Membuat Webserver Nginx Php-Fpm Mariadb Phpmyadmin Pada Freebsd 1. Mengapa Membuat Webserver Nginx Php-fpm Mariadb Phpmyadmin Pada Freebsd FreeBSD adalah sebuah sistem operasi berbasis Unix yang innovatif, kepemimpinan komunitasnya, performanya…
- How To Install Phpmyadmin On Nginx How To Install Phpmyadmin On Nginx Introduction PhpMyAdmin is an open source software program which is used to manage MySQL and MariaDB databases. It provides a graphical interface to execute…
- Cara Cek Versi Php Nginx Debian Cara Cek Versi Php Nginx Debian Apa itu Nginx Debian? Nginx Debian adalah sebuah server web open source yang dirancang untuk cara yang fleksibel, mudah digunakan, dan simultan yang memungkinkan…
- Configuration Nginx On Debian 9 Configuration Nginx On Debian 9 Introduction Nginx is a powerful open source web server that runs on Linux and provides the capability to efficiently serve content. Debian 9 is a…
- Digital Ocean Ubuntu Nginx Docker Digital Ocean Ubuntu Nginx Docker What is Digital Ocean? Digital Ocean is a cloud computing provider. It is a great platform for businesses and developers who need to quickly set…
- Node.Js Nginx Server Setup Node.Js Nginx Server Setup What is Nginx? Nginx is a popular web server and proxy server for HTTP, HTTPS, SMTP, POP3 and IMAP protocols, as well as a load balancer,…
- Install Nginx Php Mysql Phpmyadmin Centos 7 Install Nginx Php Mysql Phpmyadmin Centos 7 A Brief Overview of Centos 7 Centos 7 is a Linux distribution based on the Redhat Enterprise Linux Server, and is a popular…
- Create Subdomain Nginx Debian 9 Server Create Subdomain Nginx Debian 9 Server Understanding Subdomain A subdomain is a subsection of a domain that a user can create to host one or more websites, usually for a…
- How To Open Var Www Nginx How To Open Var Www Nginx What is Var Www Nginx? Var Www Nginx is a command line program used to create and manage web pages. It is included in…
- Nginx Php-Fpm Php Stack Overflow Articel Nginx Php-Fpm Php Stack Overflow Articel What Is Nginx? Nginx (pronounced engine-x) is an open source web server and reverse proxy software that is popular for its high performance and…
- How To Install Wordpress On Nginx How To Install Wordpress On Nginx Introduction If you’re looking to start your own website or blog, probably the easiest and most popular platform to choose is WordPress. WordPress is…
- Setup Vhost Nginx Debian 9.3 Setup Vhost Nginx Debian 9.3 Introduction This article will provide step-by-step instructions to setup Nginx Virtual Hosts (vhosts) on a Debian 9.3 system. Nginx is a web server software used…
- How To Configure Nginx Debian How To Configure Nginx Debian Introduction to Nginx Debian Nginx is a web server and reverse proxy that is used to host websites and manage incoming traffic over the world…
- 404 Nginx Phpmyadmin Centos 7 404 Nginx Phpmyadmin Centos 7 Configuration of Nginx on Centos 7 for Phpmyadmin Setting up Nginx on Centos 7 to work with Phpmyadmin is a very simple process. The first…
- Install Letsencrypt Debian 9 Nginx Install Letsencrypt Debian 9 Nginx What is Letsencrypt? Letsencrypt is an open source, free, automated SSL service that provides users with the ability to secure their websites and use HTTPS…
- Nginx Php Fpm 7.2 Nginx Php Fpm 7.2 Introduction to Nginx and PHP-FPM Nginx is an open-source web server, reverse proxy server, and load balancer. It is known for being lightweight and fast, and…