How to install nginx, MySQL, and PHP using the A2 QuickInstaller
This article describes how to use the A2 QuickInstaller to install nginx, MySQL, and PHP. This configuration is also sometimes referred to as a LEMP (Linux, "engine-x", MySQL, and PHP) stack.
The A2 QuickInstaller is no longer supported, and is only available on older VPS hosting packages. On newer VPS hosting packages, you can use Webuzo
to quickly and easily install a wide range of applications and manage your server.
To check if the A2 QuickInstaller supports this application for your Linux distribution, please see this article
Installing nginx, MySQL, and PHP
To install nginx, MySQL, and PHP, follow these steps:
- Use SSH to log in to your system as the root user.
To use the A2 QuickInstaller, you must log in as the root user using SSH. You cannot use the serial console in the VPS Control Panel to run the A2 QuickInstaller.
- To start the A2 QuickInstaller, type the following command, and then press ENTER:
- Under Application Installers, type the option number for Web/Application Servers, and then press ENTER.
- On the Web/Application Server Menu, type the option number for LEMP - Nginx, PHP, MySQL or Nginx w/PHP and MySQL , and then press ENTER. The A2 QuickInstaller updates your system, and then begins the installation process.
The installation process takes some time to complete. Do not interrupt the installation process.
- Type the system's domain name when you are prompted, and then press ENTER.
- When installation is complete, the A2 QuickInstaller displays the directory path for your web site files, how to start and stop the web server, and other configuration information.
Securing the MySQL installation
If the A2 QuickInstaller prompted you at the end of the installation procedure to run mysql_secure_installation, you should do so now to help secure your MySQL installation. The mysql_secure_installation command allows you to set the MySQL root password and configure other security settings.
If the A2 QuickInstaller did not prompt you at the end of the installation procedure to run mysql_secure_installation, then the MySQL root password was generated automatically. To view the MySQL root password, type the following command, and then press ENTER:
To secure MySQL, follow these steps:
- Type the following command, and then press ENTER:
For more information about the mysql_secure_installation command, you can type the following command:
- When you are prompted to enter the current root password, press ENTER.
- At the Change the root password? prompt, type Y.
- Type the new password.
- Re-type the new password to confirm.
- At the Remove anonymous users? prompt, type Y.
- At the Disallow root login remotely? prompt, type Y.
- At the Remove test database and access to it? prompt, type Y.
- To make the changes take effect immediately, type Y at the Reload privilege tables now? prompt.
- Application Servers
You can use the A2 QuickInstaller to install a wide variety of application servers with just a few keystrokes. You can install a LAMP stack, nginx, and more.
- Apache, MySQL/MariaDB, and PHP
One of the first things many people install on a new system is a LAMP (Linux, Apache, MySQL or MariaDB, and PHP) stack. Learn how to install one quickly and easily using the A2 QuickInstaller here.