Install Apache on Alibaba Cloud Server ECS

1. Purchase a cloud server

I bought the server of Alibaba Cloud and used the free trial server of student rights. If I want to buy it, I can buy it on the official website of Alibaba Cloud.

Aliyun official website

Please add a picture description

Find the server under the product specification. Which one to buy depends on your individual needs. I use a lightweight application server here.

Please add a picture description

Here is the place to choose the region, image, and data disk

Region: Choose a region closest to you to improve the access speed of the network

Mirror: There are many kinds of mirrors, it depends on individual needs. I use Alibaba Cloud Linux in the system mirror

Data disk: This refers to the size of the additional data disk, which depends on individual needs

Please add a picture description

Payment is final.

2. Log in to the cloud server

2.1 Reset password

After purchasing an ECS server, the system will create an ECS instance. Each ECS instance corresponds to a purchased cloud server. You can access the cloud server through the terminal tool that comes with your computer to deploy applications and build environments.

  1. In the left navigation bar, select Instances and Images > Instances .
  2. In the upper left corner of the top menu bar, select the region to which the instance belongs.
  3. On the instance page, find the target instance, click [External link image transfer failed, the source site may have an anti-leech mechanism, it is recommended to save the image and upload it directly > instance properties > reset instance password** in the operation column, follow the interface prompts Set the login password for the ECS instance. After saving the password, click Restart Now on the pop-up page to make the password take effect.

Please add a picture description

To reset a sample password, click Reset Password Offline

Please add a picture description

reboot

Please add a picture description

This process will take about a few minutes

2.2 Configure security group

1. The ID of the stand-alone instance in the instance

Please add a picture description

2. Configure security group rules

Please add a picture description

3. Release port

Click Add Manually, and here I allow SSH default port 22 and Apache default port 80 in the security group entry direction.

Please add a picture description

80 same reason

Please add a picture description

3. Example of remote connection to ECS

Return to the example page, click the remote connection under the operation column corresponding to the instance .

insert image description here

In the displayed remote connection dialog box, click Login Now corresponding to remote connection via Workbench .

insert image description here

Enter the corresponding account password to log in

3. Install Apache

1. Execute the command to install Apache and its extension packages.

yum -y install httpd httpd-manual mod_ssl mod_perl

If the command output shows Complete!, Apache is installed successfully.

2. Start Apache and set up self-starting

systemctl start httpd

systemctl enable httpd

insert image description here

3. View Apache running status

systemctl status httpd

If the command output shows active (running), it means that Apache has started.

Ctrl+C to exit

insert image description here

3. Check whether the Apache service is installed successfully

Enter http://<ECS server public network IP> in the address bar of the local computer browser to test whether the Apache service is successfully installed. If the test page shown in the figure is displayed, it means that the Apache service has been successfully installed. The EIP of the ECS server can be obtained from the ECS instance page.

insert image description here

Apache installed successfully!

Guess you like

Origin blog.csdn.net/weixin_44748171/article/details/132148406