Install Nginx Php Mysql Phpmyadmin Ubuntu 18.04
Introduction
In this article, we will demonstrate how to install Nginx, PHP, MySQL, and phpMyAdmin on an Ubuntu 18.04 server. Nginx is a powerful web server that can serve static or dynamic content. PHP is one of the most popular scripting languages for web development and is installed on most servers. MySQL is a powerful database server that will store all of your data. phpMyAdmin is a web-based interface that you can use to manage your MySQL databases.
Before proceeding with the installation of these packages, you should update all of your currently installed packages. You can do this by running the following command:
sudo apt update && sudo apt upgrade -y
Step 1 — Installing Nginx
The first step is to install the Nginx web server. To do this, run the following command:
sudo apt install nginx
Once the installation is complete, you can check the status of the Nginx service with the following command:
sudo systemctl status nginx
You should see the following output:
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-03-26 09:32:51 UTC; 2min 24s ago
Main PID: 12586 (nginx)
Tasks: 2 (limit: 1152)
CGroup: /system.slice/nginx.service
├─12586 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─12593 nginx: worker process
The output shows that the Nginx service is running. To make sure that Nginx starts automatically when the system boots up, run the following command:
sudo systemctl enable nginx
You can also check the version of the Nginx web server by running the following command:
nginx -v
Step 2 — Installing PHP
The next step is to install PHP. To do this, run the following command:
sudo apt install php7.2-fpm php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-mysql php7.2-mbstring php7.2-xml php7.2-gd php7.2-curl
Once the installation is complete, you can check the version of PHP by running the following command:
php -v
You should see the following output:
PHP 7.2.24-0ubuntu0.18.04.2 (cli) (built: Jul 21 2019 21:52:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies
Step 3 — Installing MySQL
The next step is to install MySQL. To do this, run the following command:
sudo apt install mysql-server
Once the installation is complete, you can check the status of the MySQL service with the following command:
sudo systemctl status mysql
You should see the following output:
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-03-26 09:56:52 UTC; 48min ago
Main PID: 15896 (mysqld)
Tasks: 27 (limit: 1152)
CGroup: /system.slice/mysql.service
├─15896 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid
└─15939 sleep 1
If you want to make sure that MySQL starts automatically when the system boots up, you can run the following command:
sudo systemctl enable mysql
Step 4 — Configuring MySQL
Once the installation is complete, you need to secure your MySQL installation by running the mysql_secure_installation script. To do this, run the following command:
sudo mysql_secure_installation
You will be asked a few questions during this process. It is recommended that you answer “yes” to all of them.
Step 5 — Installing phpMyAdmin
The next step is to install phpMyAdmin. To do this, run the following command:
sudo apt install phpmyadmin
Once the installation is complete, you need to create a symbolic link for phpMyAdmin from the web root directory. To do this, run the following command:
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
Once the symbolic link is created, you need to create an Apache configuration file for phpMyAdmin. To do this, create the configuration file with the following command:
sudo nano /etc/apache2/conf-available/phpmyadmin.conf
Add the following lines:
Alias /phpmyadmin /usr/share/phpmyadmin
DirectoryIndex index.php
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
Restart the Apache service to apply the changes:
sudo systemctl restart apache2
Conclusion
In this article, we have demonstrated how to install Nginx, PHP, MySQL, and phpMyAdmin on an Ubuntu 18.04 server. We have also shown how to configure each of these packages to work properly. We hope you have found this article to be helpful.
FAQs
Q. How do I start and stop Nginx?
A. To start Nginx, you can run the following command:
sudo systemctl start nginx
To stop Nginx, you can run the following command:
sudo systemctl stop nginx
Q. How do I restart MySQL?
A. To restart MySQL, you can run the following command:
sudo systemctl restart mysql
Q. How do I access phpMyAdmin?
A. To access phpMyAdmin, you can open your web browser and go to http://your-server-ip/phpmyadmin. You will be prompted to enter your MySQL username and password.
Related Posts:
- 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…
- How To Configure Nginx With Varnish How To Configure Nginx With Varnish Introduction Nginx and Varnish are powerful web server tools used to configure and optimize the delivery of web content. Nginx serves requests while Varnish…
- 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…
- Nginx Mariadb Php Fpm Debian8 Mariadb Nginx Mariadb Php Fpm Debian8 Mariadb Introduction to the Setup Nginx, MariaDB, and PHP are all popular tools for web development. Nginx is a web server, MariaDB is an open-source…
- 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…
- Digitalocean Install Nginx Ubuntu 18.04 Digitalocean Install Nginx Ubuntu 18.04 Introducing DigitalOcean and Nginx DigitalOcean is a virtual cloud server provider, allowing users to spin up virtual servers located in various geographical locations throughout the…
- Centos 6 Nginx Phpmyadmin Forbideen Centos 6 Nginx Phpmyadmin Forbidden Introduction CentOS 6, an open-source Linux operating system, is one of the most popular web server operating systems. It is considered to be a reliable…
- Setting Phpmyadmin Di Nginx Debian 9 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…
- Perfect Server Ubuntu 18.04 Nginx Perfect Server Ubuntu 18.04 Nginx 1. Introduction Ubuntu is one of the most popular Linux distributions. It is popular due to its user friendliness and availability of excellent free software…
- Cara Install Nginx Ubuntu 14.04 Cara Install Nginx Ubuntu 14.04 Step 1: Update the Software Packages The first step in installing Nginx is to update the software packages in Ubuntu 14.04. This can be done…
- Nginx Ssl Ubuntu 16.04 Nginx SSL Ubuntu 16.04 What is SSL and Nginx? SSL stands for Secure Sockets Layer. It is a protocol used to encrypt communications over the internet. It is a secure…
- Php-Fpm Nginx Ubuntu 18.04 PHP-FPM & Nginx on Ubuntu 18.04 Introduction to PHP-FPM PHP-FPM (FastCGI Process Manager) is an implementation of FastCGI, which is a standard protocol for interfacing external applications with web servers.…
- Cara Install Phpmyadmin Di Nginx Ubuntu Cara Install Phpmyadmin Di Nginx Ubuntu Pengertian PhpMyAdmin PhpMyAdmin adalah antarmuka web-berbasis yang memungkinkan Anda untuk mengelola basis data MySQL dan istilah yang lebih umum dalam pengelolaan basis data SQL.…
- Ubuntu Install Web Server Nginx Ubuntu Install Web Server Nginx Step 1: Install the Nginx Package The first step when installing Nginx on Ubuntu is to install the Nginx package from the Ubuntu repository. This…
- 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…
- Install Postgis Ubuntu 18.04 Nginx Install Postgis Ubuntu 18.04 Nginx What is Postgis? Postgis is a Postgres-based open source geographic information system (GIS) that enables users to store, query, and analyze spatial data stored in…
- Docker Nginx Php Mysql In Xampp Docker Nginx Php Mysql In Xampp Overview of Docker Nginx Php Mysql in Xampp Docker Nginx Php Mysql in Xampp is a powerful web development platform used for developing complex…
- 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 Php Nginx Ubuntu 12.04 Install Php Nginx Ubuntu 12.04 Introduction Welcome to our guide on How to install PHP, Nginx & MySQL on Ubuntu 12.04 LTS. This guide should work on other Linux VPS…
- Install Nginx Ubuntu 18.08 Local Install Nginx on Ubuntu 18.04 Local Installing Nginx on Ubuntu 18.04 can be accomplished quickly and in several different ways. Depending on your needs, some methods may be better suited…
- Install Nginx And Php On Ubuntu Install Nginx And Php On Ubuntu A Comprehensive Tutorial to Install Nginx And Php On Ubuntu Nginx and PHP are two of the most popular web server and scripting language…
- Cara Agar Mysql Diakses Hanya Menggunakan Ip Tertentu Nginx Cara Agar Mysql Diakses Hanya Menggunakan IP Tertentu - Nginx Apa itu Nginx? Nginx adalah salah satu server web populer di seluruh dunia. Nginx telah menjadi pilihan yang populer di…
- How To Install Phpmyadmin In Ubuntu 18.04 Nginx How To Install Phpmyadmin In Ubuntu 18.04 Nginx Introduction The MySQL database management system is one of the most popular and powerful open source database systems available today. To make…
- Nginx Always Displaying Default Page In Ubuntu Nginx Always Displaying Default Page In Ubuntu Introduction Ubuntu is one of the most popular Linux distributions and an immensely powerful and versatile operating system. It has a great package…
- 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…
- Install Nginx Phpmyadmin Ubuntu 18.04 Install Nginx Phpmyadmin Ubuntu 18.04 Introduction to Nginx, PHP, and Ubuntu Nginx is an open-source, high-performance web server written in C and used to serve static and dynamic webpages. It…
- Vps Webserver Nginx Php7 Mysql Vps Webserver Nginx Php7 Mysql What Is VPS Webserver? A VPS webserver is a Virtual Private Server (VPS) that has been configured to act as a web server. A VPS…
- How To Login Phpmyadmin In Nginx Server Ubuntu How To Login Phpmyadmin In Nginx Server Ubuntu What is Nginx & phpMyAdmin Nginx is a web server software that is commonly used on Linux-based systems, though it works on…
- 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…
- Speed Up Vestacp On Centos 7 Nginx Apache Speed Up VestaCP On Centos 7 Nginx Apache Overview of the Setup VestaCP is a popular hosting control panel that uses a set of open source servers and applications to…