Knowledge Base

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:

  1. 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.
  2. To start the A2 QuickInstaller, type the following command, and then press ENTER:
    sh /usr/sbin/
  3. Under Application Installers, type the option number for Web/Application Servers, and then press ENTER.
  4. 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.
  5. Type the system's domain name when you are prompted, and then press ENTER.
  6. 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:

more /root/.my.cnf

To secure MySQL, follow these steps:

  1. Type the following command, and then press ENTER:

    For more information about the mysql_secure_installation command, you can type the following command:

    man mysql_secure_installation
  2. When you are prompted to enter the current root password, press ENTER.
  3. At the Change the root password? prompt, type Y.
  4. Type the new password.
  5. Re-type the new password to confirm.
  6. At the Remove anonymous users? prompt, type Y.
  7. At the Disallow root login remotely? prompt, type Y.
  8. At the Remove test database and access to it? prompt, type Y.
  9. To make the changes take effect immediately, type Y at the Reload privilege tables now? prompt.

More Information