Solution to the problem that Alibaba Cloud host cannot access the website using IP (solved by configuring security group rules)

Solution to the problem that Alibaba Cloud host cannot access the website using IP (solved by configuring security group rules)

I just bought an Alibaba Cloud host and couldn’t wait to try out its speed. However, I couldn’t access the website, either using the IP or binding the domain name. After submitting a work order, I found out that I needed to configure security group rules. For novices like me, this article will introduce how to configure security group rules after activating the Alibaba Cloud host so that the website can be accessed from the Internet.

1. Open the security group management interface

The location of the security group management interface is Menu- > Network & Security- > Security Group . Here you can create a security group instance (if you haven't created an instance yet) or configure security group rules (if you have already created an instance when you purchased the host).

Security Group Management

Security Group Management (click on the image to enlarge)

Click " Configure Rules ". If you have not created an instance yet, you need to create one first.

2. Configure security group rules

On the security group rule configuration page, in the Inbound direction tab, click Manually add. Then configure it as shown below:

  • Authorization policy: Allow
  • Priority: 1
  • Protocol type: Custom TCP
  • Port range (destination): HTTP(80)
  • Authorization object (source): 0.0.0.0/0

Add security group rules

Add security group rules (click on the image to enlarge)

Click "Save" to complete the configuration.

At this time, you can use the IP or domain name (if it has been bound) to access the Alibaba Cloud host on the external network.

Old version - Alibaba Cloud adds security group rules

If it is an old version of Alibaba Cloud Console, the operation interface is as shown below, but the content is the same as above.

Old version - Alibaba Cloud adds security group rules

Old version - Alibaba Cloud adds security group rules (click on the image to enlarge)

The following is the supplement from xiaopeng147258

I have built a web service on Alibaba Cloud's ECS cloud host (centos7), but I cannot access my website through the external network IP.

First, you need to install the http service via yum install httpd -y

Then start the http service via systemctl start httpd

Of course, you can also set it to automatically start the httpd service at boot time via systemctl enable httpd

After the http service is turned on, if the firewall rules have been configured, you need to set the firewall to allow port 80

firewall-cmd --zone=public --add-port=80/tcp

Finally, after all these are done, it is the key step

Since the Alibaba Cloud host has port 80 closed by default, first log in to Alibaba Cloud and enter the management console

Select products and services

Then select the instance

At this time, you can see your own instance, and then click Management on the right to enter the instance details.

The core part is to click the security group of this instance, then click the security group list, and then configure the rules.

At this time, you can click Configure Rules, then click Add Group Rules, and the following interface will appear.

Note: At this time, many people may think, I originally planned to access it from the outside, but this is the rule of the intranet, which means it is still useless. In fact, this is what I am wondering about. After checking the usage documentation of Alibaba Cloud, I found that this is a vpc dedicated network, so the default is the intranet configuration. After modification, it is also valid for the external network, while the classic network needs to select the external network!

As a novice of Alibaba Cloud Host, I was unable to access WEB services after setting up the LAMP environment on the cloud host for the first time. Although I have played with LAMP on a virtual machine before, the actual environment is still very different. I have searched many blogs on the Internet but couldn’t find any practical solutions. In order to help more novice friends like me avoid detours, I wrote this blog.

This is also my first time writing a blog, so if any big guys see it, please give me more advice. I will work harder in the future to share with you the holes I have filled. Thank you all the big guys here. . . . . .

You may also be interested in:
  • Detailed explanation of adding security group rules to Alibaba Cloud Server (graphic tutorial)

<<:  Binary Search Tree Algorithm Tutorial for JavaScript Beginners

>>:  MySQL 8.0.20 installation and configuration method graphic tutorial

Recommend

Writing daily automatic backup of MySQL database using mysqldump in Centos7

1. Requirements: Database backup is particularly ...

MySQL series 6 users and authorization

Table of contents Tutorial Series 1. User Managem...

Inspiring Design Examples of Glossy and Shiny Website Design

This collection showcases a number of outstanding ...

Detailed steps to implement the Excel import function in Vue

1. Front-end-led implementation steps The first s...

Detailed tutorial on deploying apollo with docker

1. Introduction I won’t go into details about apo...

MySQL Best Practices: Basic Types of Partition Tables

Overview of MySQL Partitioned Tables As MySQL bec...

Detailed example of deploying Nginx+Apache dynamic and static separation

Introduction to Nginx dynamic and static separati...

JavaScript canvas to achieve meteor effects

This article shares the specific code for JavaScr...

JavaScript operation element examples

For more information about operating elements, pl...

Tutorial on upgrading from Centos7 to Centos8 (with pictures and text)

If you upgrade in a formal environment, please ba...

Invalid solution when defining multiple class attributes in HTML

In the process of writing HTML, we often define mu...