Amazon Linux AMI Install Linux, nginx, MySQL, PHP (LEMP)

https:/‮.www/‬lautturi.com
Amazon Linux AMI Install Linux, nginx, MySQL, PHP (LEMP)

Amazon Linux AMI is a freely available, pre-built image that can be used on Amazon Elastic Compute Cloud (EC2) to run Linux-based applications. The acronym LEMP refers to a web server stack that consists of Linux, nginx (pronounced "engine-x"), MySQL, and PHP.

To install the LEMP stack on Amazon Linux AMI, you can follow these steps:

  1. First, launch an EC2 instance using the Amazon Linux AMI image.

  2. Connect to the instance using SSH.

  3. Install nginx using the following command:

sudo yum install nginx
  1. Start the nginx service using the following command:
sudo service nginx start
  1. Install MySQL using the following command:
sudo yum install mysql-server
  1. Start the MySQL service using the following command:
sudo service mysqld start
  1. Install PHP and the PHP-MySQL module using the following command:
sudo yum install php php-mysql
  1. Restart the nginx service to enable PHP support:
sudo service nginx restart

At this point, the LEMP stack should be installed and running on your Amazon Linux AMI EC2 instance. You can verify the installation by creating a PHP file in the default document root (usually /usr/share/nginx/html) and accessing it in a web browser. The file should display information about your PHP installation, such as the version number and installed modules.

Keep in mind that this is just a general outline of the steps involved in installing a LEMP stack on Amazon Linux AMI. The exact steps may vary depending on your specific needs and configuration. It is always a good idea to refer to the official documentation for detailed instructions and further information.

Created Time:2017-10-16 14:38:35  Author:lautturi