What is a Server?
Imagine you're browsing the internet, watching videos, playing games, or chatting online. Where is all this information and content stored? It doesn't just appear out of thin air; it's stored on some very powerful computers – these computers are called servers.
You can think of a server as a "super manager" or an "information warehouse". Unlike the computers we use every day for playing games, watching movies, or writing documents, a server's main job is:
- Storing information: Like a giant warehouse, it stores website data, video files, game data, and much other information.
- Processing requests: When you open a website or play an online game, your computer sends a "request" to the server. The server, like a diligent manager, receives the request, immediately finds the information you need in the warehouse, and "sends" it back to you.
- Providing services: It runs 24/7, constantly ready to respond to requests from users all over the world, providing a variety of services such as web browsing, email, file storage, and online gaming.
So, simply put, a server is a powerful, always-on computer specifically designed to provide various network services.
What are the functions of a server?
Servers have a wide range of functions and are practically the foundation of our modern internet life. Here are some of the main functions:
-
Website Hosting (The Home of Websites):
-
Every website you see, such as Taobao, Baidu, or news websites, has all its content (text, images, videos) stored on a server. When you enter a website address, your computer "retrieves" this content from the server to display it to you.
- Simple explanation: It's like you've opened a small shop and need a storefront (server) to display your goods (website content) so that customers (users) can come in to browse and buy.
-
Storing and Sharing Files (Cloud Storage, Online Storage):
-
Services like Baidu Cloud, Alibaba Cloud, and Dropbox use servers to store your files, allowing you to access and share them on any device.
-
Simple explanation: It's like having a huge external hard drive (server) where you can store photos, videos, and files, and then access them anytime, anywhere via the internet, or share them with friends. 3. Running Applications and Games (Online Games, APP Background Processes):
-
Most online games you play, such as Honor of Kings and PUBG Mobile, require servers to manage and process their game data, player information, and game progress.
- Many mobile apps, such as WeChat and TikTok, also rely on servers for background data processing and information push notifications.
- Simplified explanation: Imagine playing a large-scale multiplayer online game; all players are in the same virtual world, and this world is maintained by a server, ensuring everyone can play synchronously.
-
Providing Email Services (Email):
-
The email services you use, such as QQ Mail, Gmail, and NetEase Mail, rely on email servers for sending, receiving, and storing emails.
- Simplified explanation: It's like a post office (email server) that receives, stores, and delivers your emails.
-
Database Services (Information Management):
-
Many applications need to store large amounts of structured data, such as user information and order information. This data is stored in database servers for quick retrieval and management.
- Simplified explanation: It's like a super-detailed phone book or ledger (database server) that helps you quickly find someone's contact information or records.
In short, servers are the "unsung heroes" of the internet world. Without them, we wouldn't be able to browse websites smoothly, use apps, play games, or send and receive emails.
How to Obtain a Cloud Server (Taking Alibaba Cloud's Hangzhou, Zhejiang Cloud Server as an Example)
Now that we know how important servers are, how can we get one? The most convenient and fastest way is to rent a cloud server. A cloud server is like "moving" a real server onto the internet; you can use it on demand, making it very flexible.
Let's take Alibaba Cloud's cloud server in Hangzhou, Zhejiang as an example to briefly explain how to obtain one:
-
Register an Alibaba Cloud Account:
-
First, you need to register an account on the official Alibaba Cloud website ([www.aliyun.com]). This process is similar to registering for a regular website account, requiring information such as your phone number and email address, and possibly real-name verification. 1. Register an account:
Register an account on Alibaba Cloud (http://www.aliyun.com). This process is similar to registering a regular website account, requiring information such as a mobile phone number and email address, and may also require real-name verification. 2. Access the cloud server purchase page:
-
After logging into your Alibaba Cloud account, find the "Products" or "Computing" category on the website, and then select "ECS (Elastic Compute Service)". 3. Select Configuration (like choosing computer specifications):
-
Region and Availability Zone: Here you need to select "Mainland China" -> "East China 2 (Shanghai)" or "South China 1 (Shenzhen)," etc. If you want to choose Hangzhou, Zhejiang, you would typically select "East China 2 (Shanghai)" or "North China 1 (Qingdao)," etc., as Alibaba Cloud's data centers are distributed throughout the country, and the Hangzhou area is usually categorized under the East China region. (Note: Alibaba Cloud's region selection is based on major regions. Hangzhou belongs to the East China region, so you can choose "East China 2 (Shanghai)" or "East China 1 (Hangzhou)," depending on Alibaba Cloud's regional division strategy at the time, but there will usually be an option close to Hangzhou.)
- Instance Type: This determines the server's performance, such as the number of CPU cores and memory size. It's like choosing i3, i5, or i7 processors, or 8GB or 16GB of RAM when buying a computer. Beginners can start with some entry-level configurations.
- Image (Operating System): You need to choose which operating system to install on the server. The most common are Windows Server or Linux (such as CentOS, Ubuntu). Linux is more commonly used in website hosting and development, while Windows is more familiar to some users.
- System Disk and Data Disk: These are the server's hard drives, used to install the operating system and store data.
- Network: Configure the server's network, including the public IP address (allowing others to access your server) and bandwidth (data transfer speed).
- Security Group: Set firewall rules to determine which network ports are open and which are closed, to protect server security.
-
Set Password or Key:
-
For secure server login, you need to set a login password or generate an SSH key pair (commonly used in Linux).
-
Confirm Order and Pay:
-
Check your selected configuration and price, then proceed with payment. Alibaba Cloud usually offers new user discounts, so keep an eye out for those.
-
Creation Successful, Obtain Server Information:
-
After payment is complete, Alibaba Cloud will create a cloud server for you. After a few minutes, you can see your server in the Alibaba Cloud console and obtain its public IP address, login username, and password (or key). 7. Logging into the Server:
-
Use the remote login tool corresponding to your chosen operating system (such as Windows' built-in "Remote Desktop Connection," or Linux SSH client tools like PuTTY or Xshell). Enter the server's public IP address, username, and password to log in to your cloud server.
Beginner's Summary: Renting a cloud server is like going to a large "computer rental company," telling them what kind of computer you need (configuration), and in which city (region) you want it located. They will prepare a computer for you, and you pay monthly or annually.
What You Need to Build Your Own Server (Simple Process)
If you don't want to rent a cloud server and instead want to build your own server at home, you'll need more things and some technical knowledge. We'll explain it in the simplest way:
-
A Computer That Never Sleeps (Hardware):
-
A computer host: This computer needs to be more stable and perform better than your everyday computer because it needs to run 24/7 without interruption. It can be an old computer, but ideally, it should be stable and have low power consumption.
- Stable power supply: Ensure your computer has a reliable power supply, preferably with a UPS (uninterruptible power supply) to provide power during outages and prevent data loss.
- Network equipment:
- Router: Your home router is essential; it connects your computer to the internet.
- Stable broadband: You need fast, unlimited broadband. Furthermore, your broadband needs to support a public IP address and allow port forwarding (more on this later). Many home broadband connections don't support this by default or require an additional application.
- (Optional) Case and cooling: If you're using a desktop computer, ensure good cooling, as the server will be running under high load for extended periods.
-
A Home That's Always Online (Network Environment):
-
Public IP address: This is the most important! Like your house number, others need this address to find your server. Many home broadband connections have dynamic IPs (which change), so it's best to apply for a static public IP address. * Port Forwarding (Opening a Door): Your router is like the front door of your house, and your server is like a room inside. For others to access your server, you need to open a "small door" (port forwarding) on your router, allowing specific types of access (such as accessing port 80 or 443 for websites) to go directly to your server room.
- Domain Name (Easy-to-Remember Name): If you want others to access your server using an easy-to-remember name (such as www.yourname.com) instead of a string of numbers (IP address), you need to register a domain name and then point that domain name to your public IP address. To access your server using a domain name (e.g., http://www.yourname.com) instead of a string of numbers (IP address), you need to register a domain name and then point that domain name to your public IP address.
-
An "obedient" housekeeper (Operating System and Software):
-
Operating System: You need to install a server operating system on your computer, such as the previously mentioned Linux (CentOS, Ubuntu) or Windows Server. Linux is generally more suitable for servers and is free.
- Server Software: Install the appropriate software depending on what you want your server to do. + Website Setup: Requires installing web server software (such as Apache, Nginx), database software (such as MySQL, PostgreSQL), and a programming language environment (such as PHP, Python).
- File Storage: You can install FTP server software or Samba server software.
- Other Services: Such as email server software, game server software, etc.
-
Security Protection (Against Malicious Actors):
-
Firewall: Both the server and router need to be configured with firewalls, allowing only necessary ports to be open to the outside world and blocking unnecessary access.
- Security Updates: Promptly update the operating system and all software patches to prevent hackers from exploiting vulnerabilities.
- Strong Passwords: Use strong passwords Use complex and difficult-to-guess passwords.
Beginner's Summary: Setting up your own server is like opening a "24-hour convenience store" at home. You need:
- A computer that runs 24/7 and has decent performance (hardware).
- Broadband that allows people outside to find your home address (public IP address), and you need to open a "door" at your entrance (router) (port forwarding) to allow specific people to enter.
- Install a working system and tools on the computer (operating system and software).
- Implement security measures to prevent theft and damage (security protection).
The advantage of setting up your own server is low cost (if you use an old computer), but the disadvantage is the high technical barrier; you need to solve a series of problems such as networking, security, and maintenance yourself, and the stability and speed of home broadband may not be as good as a professional data center.