Install a LAMP Web Server on Amazon Linux 2 Part-1

LAMP Web Server,This tutorial assist you put in an Apache internet server with PHP and MariaDB assist on your Amazon Linux 2 instance. You can use this server to host a static internet site or set up a dynamic PHP utility that reads and writes information to a database.

Step 1: Prepare the LAMP Server

Prerequisites

LAMP Web Server,Before you start, be sure that you’ve finished the stairs in Setting Up with Amazon EC2.

To launch an instance

1.Open the Amazon EC2 console at https://console.Aws.Amazon.Com/ec2/.

2. From the console EC2 Dashboard, select Instances.

3. From the console select Instances and select Launch Instance.

4. The Choose an Amazon Machine Image (AMI) page shows a listing of fundamental configurations, known as Amazon Machine Images (AMIs), that function templates for your instance. Select an HVM model of Amazon Linux 2. Notice that those AMIs are marked “Free tier eligible.”

5. On the Choose an Instance Type web page, you may select the hardware configuration of your example. Select the t2. Micro kind, which is selected by means of default. Notice that this example type is eligible for the loose tier.

LAMP Web Server,Choose Next: Configure Instance Details

6. On the Configure Instance Details web page, pick Next: Add Storage

7. On the Add Storage web page, choose Next: Add Tags

8. On the Add Tags page, pick out Next: Configure Security Group

9. On the Configure Security Group page, make certain that Select an present protection organization is selected.

Select your security institution from the list of current protection agencies, after which select Review and Launch.

choose Launch.

10. On the Review Instance Launch web page, choose Launch.

11. When prompted for a key pair, pick out Choose an existing key pair, then choose the key pair which you created while getting set up.

12. A affirmation page lets you recognize that your instance is launching. Choose View Instances to shut the confirmation web page and go back to the console.

13. On the Instances display, When you launch an example, its initial kingdom is pending. After the example starts, its kingdom changes to running and it receives a public DNS call.

Copy Public DNS call

14. On the PuTTY

  1. Start PuTTY
  2. In the Category pane, choose Session:
    1. In the Host Name box, enter user_name@public_dns_name. Be sure to specify the appropriate user name for your AMI.
  • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.
  • For a Centos AMI, the user name is centos.
  • For a Debian AMI, the user name is admin or root.
  • For a Fedora AMI, the user name is ec2-user or fedora.
  • For a RHEL AMI, the user name is ec2-user or root.
  • For a SUSE AMI, the user name is ec2-user or root.
  • For an Ubuntu AMI, the user name is ubuntu.
  • Otherwise, if ec2-user and root don’t work, check with the AMI provider.

15. In the Category pane, amplify Connection, amplify SSH, after which select Auth. Complete the subsequent:

  1. Choose Browse.
  2. Select the .Ppk record that you generated for your key pair, after which choose Open.
  3. (Optional) If you intend to begin this session again later, you can keep the session information for future use. Choose Session inside the Category tree, input a name for the session in Saved Sessions, and then select Save.
  4. Choose Open to start the PuTTY session.

16. Choose Yes. A window opens and type your username “ec2-user” and you’re linked to your instance.