Alibaba Cloud provides a comprehensive set of global cloud computing services to power Alibaba’s eCommerce ecosystem and other online businesses. Since 2009, Alibaba Cloud has been one of the leading providers in Artificial Intelligence (AI) and cloud computing. Alibaba Cloud offers cloud computing resources and services to thousands of government organizations, developers, and enterprises in more than 200 countries and regions.
This tutorial will walk through the process of configuring an Apache (ecs.g6.large) instance that runs the Linux 2.1903 LTS 64-bit operating system in Alibaba Cloud. One can also go through this tutorial to familiarize themself with operations in the ECS console.
Preparations
- First, log in to Alibaba Cloud and create an account.
- Once the Alibaba Cloud account is created, the system directs the user to add a payment method. Users can add a credit card or PayPal account as payment methods.
- After that, users need to complete real-name verifications to purchase ECS instances in the mainland China Region.
- Alibaba Cloud offers a default Virtual Private Cloud. If they do not want to use the default VPC, users can create a Virtual Private Cloud and a vSwitch in the region where they want to create an ECS instance.
- Alibaba Cloud also offers a default security group with its account. If users do not want to use the default security group, they can create a security group in the region where they want to create an ECS instance.
Step 1: Create an ECS Instance
- Login to Alibaba Cloud and go to the Custom Launch tab in the ECS console.
- In the first four steps of the instance creation wizard, complete the instance configurations.
- We are going to use the following configurations in this tutorial. Users can accept the default settings for parameters that are not mentioned in this tutorial.
Step | Parameter | Example | Description |
Basic Configurations | Billing Method | Pay-as-you-go | The pay-as-you-go billing method allows more flexible operations. |
Region |
| Once the instance is created, users cannot change the zone or region. | |
Instance Type |
| Available instance types are determined by the region that the user selects and the region’s resource inventory. | |
Image |
| After the instance is created, the application data of the image and the operating system is copied to the system disk. | |
Networking | Virtual Private Cloud | Default (vpc-bp1opxu1zkhn00g****) | Select an existing VPC. |
Public IP Address | Assign Public IPv4 Address | The system can allocate a public IPv4 address if the user selects the Assign Public IP Address option. | |
Bandwidth Billing | Pay-by-traffic | In pay-by-traffic mode, the instance is billed for data transfer over the Internet based on the amount of transferred data. | |
Peak Bandwidth | 2 Mbps | ||
Security Group | Default (sg-bp1bhjjsoiyx44hd****) | Select an existing security group. | |
System Configurations | Login Credentials | Password | User must set a password for remote connection and logon to the ECS instance. |
Instance Name | EcsQuickStart
| In this tutorial, EcsQuickStart is used as the instance name. |
- Click the Next: Preview button. Confirm the configurations in the Configurations Selected section or click the icon to modify the configurations in the Preview step.
- Next, click Save as Launch Template. In the Save as Launch Template dialogue box, set a name and version description for the template. This step is optional.
- After that, read and agree on ECS Terms of Service.
- Finally, click the Create Instance button.
- After the creation, a message page opens and, on that page, click Console to view the creation progress on the Instances page. If the instance state is running, that means that the ECS instance is created. Copy the public IP address of the instance to use when the user connects to the ECS instance.
Step 2: Add Security Group Rules
If the user didn’t add rules to the default security group or added the instance to a new security group when they created the instance, then perform the following steps:
- First, click on the instance ID to go to the instance details page.
- On that page, click Security Groups. Users can click on the ID of a security group to open its detail page.
- Next, click the Inbound tab on the Security Groups Rules page.
- Click Quick Add to add security group rules as defined in the below table. Users can accept the default settings for parameters that are not mentioned in this tutorial.
Action | Port Range | Authorization Object |
Allow | RDP 3389 SSH 22 HTTPS 443 | 0.0.0.0/0 |
- Finally, click the OK button.
Step 3: Connect to the ECS instance
- Return to the Instances page and find the EcsQuickStart instance.
- In the Actions column, select Connect.
- In the Enter VNC Password dialogue box, click the Modify VNC Password option.
- Next, modify the Password. In the Enter VNC Password dialogue box, enter the new Password and click OK.
- Configure the logon credentials.
– Test login: Enter root.
– Password: Enter the login password value that the user has set in the Logon Credentials section when creating the instance. Ecs123456 is used in this tutorial.
Step 4: Configure Apache
- First, execute the following command in the terminal to install Apache.
yum install -y httpd
- After the installation, start Apache.
systemctl start httpd
- Next, configure Apache to run on system startup.
systemctl enable httpd
Check the status of the Apache to ensure that it is running by executing the following command. If active (running) is returned as the output, Apache is running.
systemctl status httpd
- After that, open a web page in a browser and hit the below URL. In the below URL, replace <Public IP Address> with the public IP address of the instance.
http://<Public IP Address>
Step 5: View Bills
- In the top navigation bar, go to Expenses >> User Center.
- In the left-side navigation panel, select Spending Summary >> Spending Summary. On the Bills page, click the Details tab.
- Select the instance name from the list (EcsQuickStart) and press ENTER to start the search.
Conclusion
This tutorial presents the steps to create an Apache Linux instance in the ECS console of Alibaba Cloud. Hope this tutorial was useful, and do reach out to us if you have any query or suggestions.