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
- Start PuTTY
- In the Category pane, choose Session:
- In the Host Name box, enter
user_name
@public_dns_name
. Be sure to specify the appropriate user name for your AMI.
- In the Host Name box, enter
- 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
orroot
. - For a Fedora AMI, the user name is
ec2-user
orfedora
. - For a RHEL AMI, the user name is
ec2-user
orroot
. - For a SUSE AMI, the user name is
ec2-user
orroot
. - For an Ubuntu AMI, the user name is
ubuntu
. - Otherwise, if
ec2-user
androot
don’t work, check with the AMI provider.
15. In the Category pane, amplify Connection, amplify SSH, after which select Auth. Complete the subsequent:
- Choose Browse.
- Select the .Ppk record that you generated for your key pair, after which choose Open.
- (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.
- 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.