How to Install LEMP Stack with PhpMyAdmin in Ubuntu 20.04 (ok) full
https://www.tecmint.com/install-lemp-with-phpmyadmin-in-ubuntu-20-04/
Last updated
https://www.tecmint.com/install-lemp-with-phpmyadmin-in-ubuntu-20-04/
Last updated
doc bai nay de cau hinh phpmyadmin
Note: Khong hieu sao phai cai them cai nay moi vao duoc phpmyadmin
matkhau toi dung la: 123456 Chú ý phải cài dbmaria trước khi cài phpmyadmiin và khi cài dbmaria pass mặc định là rỗng :)
Da thanh cong 22052021
https://websiteforstudents.com/install-phpmyadmin-on-ubuntu-20-04-18-04-with-apache/
For those of you who don’t know what LEMP is – this is a combination of software packages – Linux, Nginx (pronounced EngineX), MariaDB and PHP.
You can use LEMP for both testing purposes or in a real production environment to deploy web applications using PHP frameworks such as Laravel or Yii, or content management systems such as WordPress, Drupal, or Joomla
You may wonder what’s the difference between LAMP and LEMP. Well, the only difference is the web server that is included – Apache (in LAMP) and Nginx (in LEMP). Both web servers are pretty good and while Apache is the most frequently used one, Nginx doesn’t back down in any way.
Another widely-used application normally installed alongside the LEMP stack is PhpMyAdmin – is a PHP web-based tool for administering a MySQL/MariaDB database server from a web browser.
If you looking for a LAMP setup for your Ubuntu 20.04, then you should read our LAMP setup guide on Ubuntu 20.04.
Prerequisites:
In this article, you will learn how to install and configure the LEMP stack with PhpMyAdmin in Ubuntu 20.04 server.
1. Nginx is a fast modern web server designed to server many concurrent connections without consuming too many server resources. This is why it’s often the preferred choice in enterprise environments.
NGINX is also commonly used as a load balancer and web content cache. It supports Name-based and IP-based virtual servers (analogous to virtual hosts in Apache).
You can install Nginx on your Ubuntu 20.04 desktop or server by running the following command.
The Nginx configuration files are stored under the /etc/nginx directory and its main configuration file is /etc/nginx/nginx.conf. Importantly, its default document root for storing your web files is /usr/share/nginx/html/. But you can use the standard /var/www/html which should be configured in your website’s or application’s server block configuration file.
2. The Ubuntu package installer triggers systemd to start the Nginx service and enable it to automatically start every time the server is rebooted. Use the following systemctl commands to confirm that the service is running and is enabled.
3. Now it’s time to check if the Nginx installation was successful by calling the Nginx page via browser using server IP Address.
If you don’t know your server IP address, you can find using IP command as shown.
4. MariaDB is a relatively new relational database management system that was designed as a community fork of MySQL after it’s Oracle acquisition.
The installation of MariaDB is simple and can be started with command as:
Install MariaDB on Ubuntu 20.04
5. The MariaDB service is also automatically started and enabled to always start at system boot and you can confirm this using the following commands.
Check MariaDB Service
6. If you wish to improve the MariaDB security, you can run the mysql_secure_installation
command, which will provide some basic, yet important options to configure:
Then choose the option to set the database root (or administrator) user’s password and follow the prompts and carefully read the questions. To secure your database server, answer the questions as shown in the screenshot.
Enter current password for root (enter for none): Enter
Set a root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
7. To create, manage, and perform database operations, you need to mysql shell command with the -u
flag to specify the database username and -p
to provide the user’s password.
To connect as the root user, use the sudo command (even without the -p
flag) otherwise you will receive the error highlighted in the following screenshot.
8. PHP is a popular open-source, flexible, and dynamic scripting language for building websites and web applications. It supports a variety of programming techniques. Importantly, the PHP community is large and diverse, composed of countless libraries, frameworks, and other useful components.
NGINX uses FPM (FastCGI Process Manager) or PHP-FPM, to process PHP scripts. PHP-FPM is a widely-used alternative PHP FastCGI implementation that ships with many additional features and it is used for powering high-traffic sites/web applications.
To install PHP and PHP-FPM, run the following command which will also install some required additional packages.
Install PHP and PHP-FPM on Ubuntu 20.04
Since PHP 7.4 is the default version of PHP in Ubuntu 20.04, the PHP configuration files are located in /etc/php/7.4/ and the PHP-FPM configuration files are stored under /etc/php/7.4/fpm.
9. Next, check if the php7.4-fpm service is up and running and whether it is enabled with the following command.
10. Now you need to configure NGINX to proxy client requests to PHP-FPM, which by default is configured to listen on a UNIX socket as defined by the listen parameter in the /etc/php/7.4/fpm/pool.d/www.conf default pool configuration file.
Configure PHP-FPM Socket
11. In the default server block configuration file (/etc/nginx/sites-available/default), uncomment the location directive for processing PHP requests to look like the one shown in the following screenshot.
Configure Nginx Block to Use PHP-FPM Socket
Save the file and exit.
12. Then test the NGINX configuration syntax for correctness. If it is OK, restart the Nginx service to apply the new changes.
Check Nginx Configuration
13. Now test if NGINX can work in conjunction with PHP-FPM to process PHP requests. Create a simple info.php page under the document root directory.
14. In your browser, navigate using the following address. The PHP configuration page should load showing as shown in the following screenshot.
Check PHP and PHP-FPM Info
15. PhpMyAdmin is a free and open-source web-based PHP application specifically created for administering MySQL/MariaDB database servers through a web browser. It provides an intuitive graphical interface and supports a wide range of common features for database administration tasks.
Install PhpMyAdmin in Ubuntu 20.04
16. During the package installation, you will be asked to configure several aspects of the PhpMyAdmin package. First, will be prompted to choose the default web server for running it. Press Esc because NGINX is not on the list provided.Choose Web Server to Configure PHPMyAdmin
17. Next, PhpMyAdmin requires a database to work with. In this package configuration prompt, choose Yes
to configure a database for PhpMyAdmin with the dbconfig-common package.Configure Database for PhpMyAdmin
18. In the next prompt, you need to provide a password for PhpMyAdmin to register with the MariaDB database. Enter a secure password and click Enter.Create a Password for PhpMyAdmin
Nhớ Pass vừa đăng ký và nhập user: phpmyadmin
19. To enable NGINX to serve the PhpMyAdmin site located at /usr/share/phpmyadmin, create a symlink for this directory under the document root, then set the correct permissions and ownership on the PHPMyAdmin directory as follows.
20. Besides, ensure that the index directive in the default server block configuration (/etc/nginx/sites-available/default) file includes index.php as shown in the following screenshot.Configure Nginx Index Directive
21. Next, restart the Nginx service once more to apply the above changes.
22. Now access the PhpMyAdmin site from a browser using the following address.
At the login page, authenticate with the PHPMyAdmin username and password. Remember the remote root user login is disabled unless you are accessing PHPMyAdmin on the localhost where the MariaDB database is installed, the root access will not work.PhpMyAdmin LoginPhpMyAdmin Dashboard
Last but not least, secure your PhpMyAdmin installation using our guide: 4 Useful Tips to Secure PhpMyAdmin Web Interface.
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Chú ý cài còn có cách cài đặt thủ công
phpMyAdmin is a free web-based management tool for managing the MySQL and MariaDB database servers. Web hosting companies widely use it to enable users to manage databases.
phpMyAdmin helps the system administrator perform database activities such as creating, deleting, and querying databases, tables, columns, etc.
This post will show how to install phpMyAdmin with Nginx on Ubuntu 22.04.
Before installing phpMyAdmin, install MariaDB or MySQL database server and an Nginx web server.
First, follow the Nginx installation procedure to install the Nginx server web server.
READ: Install LEMP Stack on Ubuntu 22.04
Then, install MariaDB or MySQL server by following the below tutorials for preparing your system for phpMyAdmin.
READ: Install MariaDB on Ubuntu 22.04 / Install MySQL on Ubuntu 22.04
Next, install PHP and required extensions for phpMyAdmin.
The phpMyAdmin package is available in the Ubuntu repository. But, the package available in it is a bit older version. So, we will download the latest version of phpMyAdmin from the official website.
Then, extract phpMyAdmin using the tar
command.
And then move the phpMyAdmin to the desired location.
First, rename the phpMyAdmin’s sample configuration file for configuring the phpMyAdmin.
Then, edit the configuration file to make a few changes.
Generate a blowfish secret and update the below line with the generated secret in the configuration file.
You may also need to uncomment the phpMyAdmin storage settings.
phpMyAdmin requires database tables. So, import the create_tables.sql comes with the phpMyAdmin archive package to create tables for phpMyAdmin.
Next, log in to MariaDB.
Then, add the user and grant permission to phpMyAdmin’s database.
Create a server block configuration file for phpMyAdmin under the /etc/nginx/conf.d directory. If you have installed Nginx from the Ubuntu repository, you need to create the file under /etc/nginx/sites-available
directory.
Use the following server block for phpMyAdmin. You may change the domain name (server_name) as per your requirement (use only the domain name, not the IP address).
Next, create a temporary directory for phpMyAdmin and then change the permission.
Then, set the ownership of the phpMyAdmin directory.
Finally, restart the Nginx and PHP services.
The MariaDB root user can log in locally via Unix socket by default. So, you will need to create a database and a user to log in to phpMyAdmin.
Alternatively, you can disable Unix socket authentication and enable native password login.
Now, access the phpMyAdmin via browser by going to the phpMyAdmin’s URL.
http://fully-qualified-domain-name
Log in with the database user.
Login to phpMyAdmin
You will get the home page where you can manage databases.
phpMyAdmin with Nginx
I hope this post helped you install phpMyAdmin with Nginx on Ubuntu 22.04. Share your feedback and issues you have encountered while setting this up in the comments section.
https://www.how2shout.com/linux/how-to-install-phpmyadmin-with-apache-on-ubuntu-22-04-lts/
Heyan Maurya Last Updated: June 17, 2022 UBUNTU 2 COMMENTS
Tutorial to learn the steps for installing phpMyAdmin on Ubuntu 22.04 LTS Jammy JellyFish using Apache Web server for managing MariaDB or MySQL via web browser and graphical user interface.
phpMyAdmin is popular open-source software that we can get almost on all web hosting services for managing databases. However, if you are managing your hosting or cloud server by yourself then you have to install this Database management by yourself.
The program offers a graphical interface with numerous options. These can refer to a complete database and include, for example:
• Creating a new database • Delete an existing database • Copy the content to a new database • Backup in a backup • Restore from an existing backup • Transferring from one server to another • Changing users and passwords • Manipulation of access rights
We can perform complex and time-consuming tasks without having to deal with commands and their structure with the help of phpMyAdmin. These include, but are not limited to:
• Find variable names or content in databases • Replacing Values • Encryption of plain text using different algorithms, e.g. passwords • Multiple selections of variables via the graphical interface • Checking databases for internal consistency and other errors • Create and delete entries, parameters, or values • Create, copy or remove individual tables • Clear presentation of the structure of databases
Let’s learn how to install phpMyAdmin on Ubuntu 22.04 Server, however, the steps are given here will also be the same for other versions of this Linux.
Contents [show]
To perform this tutorial we require an Ubuntu server, a non-root sudo user access, Apache webserver, Database, PHP, and an active internet connection.
The first thing we should perform is updating our Linux server because most of the packages we need to set up phpMyAdmin will come from the default Ubuntu Jammy JellyFish repository.
Copy Me
Also, install:
Copy Me
We need LAMP Stack which refers to a software bundle comprised of Apache, MySQL/MariaDB, and PHP installed on a Linux server. Well, for the Linux server, here we are using Ubuntu whereas, the rest we will install in this step.
Apache Webserver
Apache is an open-source web server that is available to install directly using Ubuntu’s default repository:
Copy Me
Enable its server:
Copy Me
Copy Me
Setup MariaDB server
Next, install the MariaDB server which is a fork of MySQL, and work exactly similar to it. Just like apache, it is also available to set up using the default system repository.
Copy Me
Enable and start
Copy Me
Also, secure your MariaDB installation:
Copy Me
As you run the above command, it will give a text-based wizard to secure your Database server. Here are the questions it will ask:
Copy Me
Install PHP and its extension
phpMyAdmin is a PHP-based SQL database management software, hence we need this scripting language on our Ubuntu system along with some common PHP extensions.
Copy Me
Also, enable PHP fpm to start with FPM, if not already:
Copy Me
Well, the one way to install phpMyAdmin is to use the APT package manager that will download and install it using Ubuntu’s repository. However, the thing which one should be aware of is that the version of phpMyadmin installed using APT will not be the latest one. It is because the long-term version of Ubuntu uses extremely stabled packages, therefore you won’t get the latest release of the software. In such a situation, we can manually download the package of phpMyadmin to configure. Let’s see how to do that.
Download phpMyAdmin latest version
The given command will automatically fetch and save the latest phpMyAdmin’s compressed file in Tar format. Just copy and execute it in your command terminal:
Copy Me
Extract and configure
Once the file is downloaded on your system, extract and move it to your webroot directory.
Extraction:
Copy Me
Now, move it:
Copy Me
Also, don’t forget to create a Temporary folder called ‘tmp’ inside the extracted directory otherwise this will create a warning on the phpMyAdmin interface.
Copy Me
To work properly, phpMyAdmin needs Blowfish cipher string in the configuration file for cookie authentication. However, by default, there is no main configuration file because we are setting up the phpMyAdmin manually. Instead, there is a sample configuration file that we can rename and use. Here is a command for that:
Copy Me
Now, generate a 32-bit random string:
Copy Me
Copy the string generated by the above command:
Now, edit the phpMyAdmin configuration file
Copy Me
and past it in the front of the line :
Copy Me
Replace your key with the generated code.
Also, scroll down to the end and add this line.
Copy Me
After that save your file by pressing Ctrl+O, hit the Enter key, and then exit the file editor- Ctrl+X.
Give Apache permission to access PHPMyAdmin files:
Copy Me
File and directory permission:
Copy Me
Copy Me
We don’t want to serve the phpMyAdmin user interface on our root domain or IP address, hence, we either use subdomain or subfolder. Here we are serving it in a subfolder. Hence, create a configuration file for it.
Copy Me
Copy Paste the following lines:
Copy Me
Save the file- Ctrl+O hit Enter, and exit using Ctrl+X.
Activate new configuration:
Copy Me
Restart the Apache Webserver
To make the changes apply successfully, restart the Apache webserver.
Copy Me
Enter the server IP address or domain name along with /phpmyadmin
folder in the browser URL to access this web database management platform.
For example:
Copy Me
or
Copy Me
Enter the MySQL database root user and its password to login phpMyAdmin.
Note: If you get this notification at the footer – The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why. Or alternately go to the ‘Operations’ tab of any database to set it up there.
Then simply click on the Find out why link and click the “Create” link to automatically create phpmyadmin
database.
Conclusion
In this way, we can swiftly install the phpMyAdmin on Ubuntu 22.04 LTS Jammy for managing our MySQL or MariaDB database with the help of a web-based graphical user interface. Because of its security, its extensive functionality, and its comfortable operation, PhpMyAdmin is considered the standard for the administration of MySQL and MariaDB databases. It is included in web hosting offers at many Internet Service Providers (ISPs) and is usually part of the basic configuration of Dedicated and Linux Virtual Servers (VPS). The most common tasks include regularly creating a backup, transferring databases to other servers, and troubleshooting technical failures.
For more, you can visit the official documentation.
Aaron KiliFebruary 5, 2021 CategoriesNginx, Ubuntu 18 Comments
The NGINX default web page should load as shown in the following screenshot, confirming correct installation and operation.Test Nginx Installation
Your LEMP setup is now complete and you can start building your web applications or simply play with the Nginx and MariaDB services you just installed. These are widely used and gaining more knowledge in them is highly recommended for system administrators.TagsLEMP Guides, Ubuntu TipsPost navigationHow to Install LAMP Stack with PhpMyAdmin in Ubuntu 20.04How to Install and Configure Memcached on UbuntuIf you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.