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 Mysql Phpmyadmin Ubuntu Install Nginx Mysql Phpmyadmin Ubuntu 1. Introduction In today's tutorial, we will show you how to install Nginx, MySQL, and phpMyAdmin on Ubuntu 20.04. Nginx is an open source web…
- Cara Install Nginx Debian 4.9 Cara Install Nginx Debian 4.9 Introduction Debian 4.9 is a major release of the Debian Linux-based operating system. It is the first major version of the operating system to be…
- Openldap Slapd Php Nginx Ldap Centos Openldap Slapd Php Nginx Ldap Centos What is OpenLDAP OpenLDAP is an open-source implementation of the Lightweight Directory Access Protocol (LDAP) and is offered by the OpenLDAP project. OpenLDAP is…
- Can I Install Phpmyadmin In Nginx Can I Install Phpmyadmin In Nginx? PHPmyadmin is a web-based management tool for databases such as MySQL and MariaDB. It is a popular tool for web developers and database administrators…
- E Unable To Locate Package Nginx E Unable To Locate Package Nginx What is Nginx? Nginx is an open-source web server and reverse proxy that is used for hosting websites, web applications, and other network services.…
- Setting Domain Ke Vps Nginx Setting Domain Ke Vps Nginx What is Nginx? Nginx is a powerful web server and popular application development platform that can be used to build efficient web applications. It was…
- Konfigurasi Web Server Nginx Debian 7 Konfigurasi Web Server Nginx Debian 7 Pengenalan Konfigurasi Web Server Nginx Debian 7 Nginx adalah mesin web yang populer di Linux dan sistem Unix. Ini adalah alternatif Anda ke mesin…
- Centos 6 Nginx Multiple Php Version Centos 6 Nginx Multiple PHP Versions What is CentOS 6? CentOS 6 is a Linux-based operating system. It is a free, open-source operating system that is based on Red Hat…
- Webmin Module For Nginx Web Server Webmin Module For Nginx Web Server Introduction to the Nginx Web Server Nginx is an open source web server and reverse proxy that offers powerful performance in a lightweight package.…
- Nginx Php-Fpm Php Mariadb Mysql Centos 7.2 Digitalocean Nginx, Php-Fpm, Php, Mariadb, Mysql, Centos 7.2 Digitalocean Introduction: What is Nginx? Nginx is a powerful web server that was first released in 2004. It is known for being a…
- 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…
- 502 Bad Gateway Nginx 1.10.3 Debian 502 Bad Gateway Nginx 1.10.3 Debian What Is a 502 Bad Gateway? A 502 Bad Gateway error is an HTTP status code that is displayed when a server cannot process…
- Install Nginx Php Java On Centos 7 Install Nginx Php Java On Centos 7 What is Nginx? Nginx is an open source Web server created to serve Web traffic efficiently, reliably, and quickly. Nginx has become the…
- 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…
- 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…
- Install Rails On Ubuntu Nginx Rbenv Install Rails On Ubuntu Nginx Rbenv Introduction Rails is an open-source web application framework written in Ruby. It is designed to make programming web applications easier by providing a full…
- Debian 502 Bad Gateway Nginx Fix Debian 502 Bad Gateway Nginx Fix What is a 502 Bad Gateway Error? A 502 Bad Gateway error is an HTTP status code displayed on your computer’s web browser when…
- Create Domain Using Nginx Virtualmin Title: Create Domain Using Nginx Virtualmin Create Domain Using Nginx Virtualmin What is Nginx Virtualmin? Nginx Virtualmin is an automated website management platform from Virtualmin. It provides a powerful web…
- Nginx Https Letsencrypt Setting Location Nginx Https Letsencrypt Setting Location Introduction to Nginx and HTTPS Nginx is an open source web server that is very popular in the web hosting industry. It is extremely flexible,…
- Replace Apache To Nginx Ubuntu 18 Replace Apache To Nginx Ubuntu 18 Installing Nginx Ubuntu 18 uses Nginx as its default web server, and it is pre-installed. However, if you want to use a fresh version…
- Install Nginx Di Kali Linux Install Nginx Di Kali Linux Introduction Kali Linux is a well-known operating system specially designed for Penetration Testing and Security Auditing tasks. The operating system is loaded with all the…
- 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…
- Step By Step Install Nginx And Phpmyadmin On Ubuntu Step By Step Install Nginx And Phpmyadmin On Ubuntu Introduction Setting up a web server on Ubuntu is easy and straightforward. Nginx is a popular web server for Ubuntu, and…
- Cara Reboot Nginx Di Linux Debian Proxmox Cara Reboot Nginx Di Linux Debian Proxmox Apa itu Nginx dan cara kerjanya? Nginx adalah salah satu web server yang paling populer digunakan saat ini. Ini berfungsi sebagai web server…
- Cara Hack Server Nginx Ubuntu Cara Hack Server Nginx Ubuntu Introducing Nginx and its Environmental Set Up Nginx is a powerful open source web server that is used to deploy the popular Linux operating system…
- Setup Nginx Web Application Firewall Setup Nginx Web Application Firewall What is Nginx WAF? Nginx Web Application Firewall (WAF) is a configuration-based firewall system used by web applications and websites. It is designed to protect…
- Install Phpmyadmin Nginx Ubuntu 16.04 Install Phpmyadmin Nginx Ubuntu 16.04 What is PhpMyAdmin? PhpMyAdmin is an open-source software for managing MySQL databases. It can be used to add, modify, and delete databases, tables, and columns.…
- Install Nginx Phpmyadmin Centos 7 Install Nginx Phpmyadmin Centos 7 What is Nginx? Nginx is a web server that is used in Linux-based operating systems such as Centos 7. It is designed to handle high-traffic…
- Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed What Is Nginx? Nginx is a web server software, similar to Apache, used for serving webpages. It is open source, and is often…
- Install Mysql Pada Nginx Pada Ubuntu Install Mysql Pada Nginx Pada Ubuntu Overview of Nginx and Its Benefits Nginx is a web server, reverse proxy server, and mail proxy server application that is open-source and available…