Recently, I saw that Alibaba Cloud has student discounts, allowing me to use a cloud server for free for a year, so I ordered an Alibaba Cloud server and registered a new domain name. The specific situation can be referenced here: https://x1g.la/university-aliyun.html This article shares my thoughts and experiences on purchasing and using cloud servers and registering domain names.
Purchasing Cloud Servers#
There are many service providers for purchasing cloud servers, both domestically and internationally, such as Alibaba Cloud, Tencent Cloud, Microsoft Azure, and Oracle. It is recommended to prioritize foreign servers when conditions permit.
Taking Alibaba Cloud as an example, refer to here
In the server location selection options, please choose an overseas location (if available), because domestic servers require an ICP-registered domain name to access, while overseas ones do not.
Cloud Server Configuration#
System Selection#
Cloud servers support various Linux distributions, with CentOS recommended for its stability and compatibility.
Connecting to the Cloud Server#
You can connect to the cloud server by downloading and installing Xshell or other similar software. The following are the specific steps using Xshell as an example:
- Click "New Session".
- Fill in the server-related information in the pop-up window.
Installing Docker and Changing the Image Source#
Docker is an important software for servers and can be obtained via the command:
curl -fsSL https://get.docker.com | bash -s docker
Start Docker, check the version and service status:
service docker start
docker version
systemctl status docker
Change the Docker image source to improve download speed in China:
- Edit the daemon.json file:
sudo vi /etc/docker/daemon.json
- Add the following content to the file:
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://dockerproxy.com"
]
}
- Restart Docker
service docker restart
Installing Management Panel#
To operate the Linux server more conveniently, you can install a management panel, such as Baota Panel or 1Panel.
Baota Panel: https://www.bt.cn/
1Panel: https://1panel.cn/
Installing Services and Setting Up Firewalls or Security Groups#
After installing the panel, you can install the required applications in the panel's app store, such as blog systems (Hexo, WordPress, etc.). When accessing the application ports via a browser, you need to allow the corresponding ports in the security group of the cloud server console.
About Domain Names#
Domain Name Registration#
For domain name registration, it is recommended to prioritize foreign registrars. Domestic registrars require real-name authentication of personal information, and the authentication process may take several hours to days.
Additionally, some platforms offer free second-level domains, which is a good choice for users with limited budgets.
Hosting Domain Names to DNS Servers#
After registering a domain name, you need to host it to a DNS server to use the domain for website access. Well-known DNS service providers include:
Domain Hosting Process Using Cloudflare as an Example#
- Register and log in to your Cloudflare account.
- In the Cloudflare dashboard, click "Add Site".
- Enter your registered domain name and click "Start DNS Record Scan".
- Based on the scan results, confirm or manually add the necessary DNS records (such as A records or CNAME records).
- Once set up, Cloudflare will provide two name server addresses, such as:
ns1.cloudflare.com
ns2.cloudflare.com
- Log in to your domain registrar account and change the domain's name servers to the addresses provided by Cloudflare.
- Wait for DNS resolution to take effect (usually takes a few hours to 24 hours).
- Enable "Proxy Status" (orange cloud icon) in Cloudflare to use its CDN and protection features.
After completing these steps, your domain will be successfully hosted on Cloudflare, and you can enjoy its free DNS, CDN acceleration, and security protection services.
About Domain Name Registration#
Regarding whether domain names need to be registered, if the server is overseas, registration is not required; if the server is in China, registration is required.
Once a domain name is registered, the website is subject to regulation by the Chinese government, and the website's content and functionality are restricted by laws and policies.
Summary#
Purchasing cloud servers and registering domain names are fundamental steps in building a website. By choosing the right server provider and domain registrar, as well as learning basic configuration and operational skills, you can quickly set up your own internet application environment. I hope this article provides some practical references for friends interested in these areas.