Accelerate and Protect Your Website Using Anti-DDoS Premium with CDN Interaction
By Victor Mak, Alibaba Cloud Solution Architect.
This tutorial is a step-by-step guide on how you can accelerate and protect your website hosted outside of Mainland China using Anti-DDoS premium with CDN interaction.
Alibaba Cloud provides DDoS protection capabilities to help customers to mitigate the risks of such attacks. In the past, customers usually had to choose between protection or acceleration, as some security services are incompatible with acceleration services. However, now, Alibaba Cloud DDoS protection can be used in combination with Content Delivery Networks (CDN), ensuring that there won't be any attacks to your traffic that's going through CDN.
Prerequisites
Before you begin, make sure of the following:
- You have a valid Alibaba Cloud account. If not, sign up with Alibaba Cloud, and add a payment method so that you can make purchases with your account.
- You have a website that is online, that is, it can be accessed from the Internet. In this article, we will use the website, which I have hosted on an OSS domain as an example. The specific website address is: http://websitetemplate.oss-cn-hongkong.aliyuncs.com.

Procedure
So, let's get started. Follow the steps below.
Configure CDN to Accelerate Your Website
1. Log on to the CDN console
2. Choose Domain Names, click Add Domain Name

3. Enter the required information, select outside of Mainland China, then click Next:

4. You will see a result like the one below:

Configure Anti-DDoS Premium to Protect Your Website
1. Log on to the Anti-DDoS Premium console
2. Click Purchase Instances

3. In order to use CDN in combination with Anti-DDoS, you will need to purchase the Enhanced Edition. For the detailed information about the features of each edition, reference to this document.

4. Now the Anti-DDoS premium instance is ready.

5. Configure the Anti-DDoS premium in the Website Config tab under Provisioning. Enter the required information, then click Add:

6. You will see the result as follows. You are now ready to configure CDN Interaction in Anti-DDoS Premium:

Configure CDN Interaction in Anti-DDoS Premium Sec-Traffic-Manager
1. Go to Sec-Traffic Manager under Provisioning, and then go to CDN Interaction.

2. Click Add Interaction. For this, you'll need to define Requests per Second. In the future, if the requests per second detected is greater than the number you specify here, Sec-Traffic Manager will automatically switch to Anti-DDoS Premium to protect your original site. We'll set the number 50 as the number for example purposes here.

3. You will see the domain already starting to interact with CDN.

Update the DNS Record
1. After you configure CDN Interaction, Anti-DDoS Premium Sec-Traffic Manager will give you the CNAME.

2. You need to add a CNAME record into your existing domain provider. In this article, we use Alibaba Cloud DNS as an example.
3. Go to Alibaba Cloud DNS console and select the domain.

4. Click Add Record to add a CNAME record, for the value use the CNAME given by Sec-Traffic Manager.

5. You are now able to access the website with www.alibabacloud.life.

Verify the result
1. When there is no attack, you can see the Sec-Traffic Manager will route to traffic to CDN. You can verify by a ping test.

2. Let's generate some workload by use AB stress test tool with 100 concurrent users

3. You will see the Sec-Traffic Manager automatically route all the traffic to Anti-DDoS Premium after it exceeded the request per second we defined.

The views expressed herein are for reference only and don't necessarily represent the official views of Alibaba Cloud.
Read previous post:
Read next post:
-
-
Alibaba Clouder
2,593 posts | 797 followers
Follow
Comments
-
-
Alibaba Clouder
2,593 posts | 797 followers
Follow
Related Products
-
OSS(Object Storage Service)
An encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world
Learn More -
ECS(Elastic Compute Service)
Elastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn More
More Posts by Alibaba Clouder
- MyBatis with a More Fluent Experience
- Alibaba Cloud Sustainability Report 2021
- Comparing CNI Models in Container Service for Kubernetes — Alibaba Cloud Series Part 1
- [Infographic] 5 Steps to Accelerate Your Digitalization in Asia
- Attackers Use the Vulnerability of ShowDoc to Spread Botnets
- Powerful: MyBatis and Three Streaming Query Methods
- What is the Difference between Spring Boot and Spring?
- What are the Differences and Functions of the Redo Log, Undo Log, and Binlog in MySQL?
- On the In-Depth Cluster Scheduling and Management
- Alibaba Technological Practices: Experiences in Cloud Resource Scheduling