Create a Linux instance from an OS image and install Apache. This example uses Alibaba Cloud Linux.
Prerequisites
-
You have created an Alibaba Cloud account on the international site (alibabacloud.com).
-
A credit card or PayPal account is linked. Payment methods.
Step 1: Create a Simple Application Server instance
-
Go to the Servers page in the Simple Application Server console.
-
In the middle of the page, click Create Server.
-
On the Simple Application Server page, configure the instance.
Configure the following parameters. The complete parameter reference is in Create a Simple Application Server instance.
Parameter
Example
Description
Region
Singapore
Choose a region close to your users to reduce latency. Regions outside mainland China, such as China (Hong Kong) and Singapore, provide international bandwidth. Users in mainland China may experience high network latency. Regions and network connectivity.
Servers
-
Instance family: General-purpose
Select an instance family. Click
to view more instance families. Instance families.Instance family types include General-purpose, Multi-Public IP, International, and Storage-optimized. Click the dropdown arrow on the right side of a plan row to expand and view more plans. After selecting a plan, the specifications such as vCPU, memory, system disk, data transfer plan, peak public bandwidth, and static public IP address are displayed below.
Image
-
OS Images: Alibaba Cloud Linux
-
Tag: 3.21.04
Select an image type and version.
Click Show Other Images to view more images.
-
OS Images (OS only): a clean image for installing applications.
-
Application Images (OS + application): a pre-configured environment for deploying development stacks or websites.
-
Custom Images: an image created from a Simple Application Server instance or snapshot, used to replicate the same configuration.
Purchase Settings
-
Quantity: 1
-
Duration: 1 Month
Select the quantity and subscription duration. Auto-renewal is enabled by default.
-
-
Click Buy Now and complete the payment.
Step 2: Connect to the Simple Application Server instance
Connect to the instance using Connect with One-click on Workbench. Other connection methods are covered in Connect to a Linux server.
-
On the server card, click Connect.
-
In the Connect dialog box, select Connect with One-click on Workbench and click Log on Now.
-
Use the terminal to manage your instance.
When you use the one-click password-free logon feature, you log on as the Admin user by default. The Admin user has limited permissions for operations that require root privileges. To log on as root, first set a password or set a key pair.
Step 3: Set up the environment
This section shows you how to install the Apache service to set up an environment on the instance. Additional tutorials: set up an environment, build a website.
-
Install Apache:
sudo yum install -y httpd -
Start Apache and enable it on boot:
sudo systemctl start httpd sudo systemctl enable httpd -
Check the Apache service status:
systemctl status httpdIf
active (running)is shown in the output, Apache is running normally.Active: active (running) since Tue 2021-06-01 17:42:44 CST; 6s ago -
Open
http://<Public IP address of the Simple Application Server>in a browser to view the Apache test page.The public IP address is shown on the server card.
A page like the following confirms Apache is deployed successfully.
