For a long time, servers were something I used without really understanding.
很长一段时间里,我一直在使用各种由服务器提供的服务,却并不了解服务器本身。
Websites, online games, cloud storage, and network tools all depended on machines running somewhere else.
网站、网络游戏、云存储以及各种网络工具,都依赖某个地方持续运行的机器。
But those machines had always belonged to someone else.
但那些机器一直都属于别人。
I wanted a server that I could control myself.
我想拥有一台真正由自己控制的服务器。
It did not need to be powerful.
它不需要拥有很强的性能。
It only needed to stay online, provide a public IP address, and allow me to install and test services freely.
它只需要能够长期在线、拥有公网 IP,并允许我自由安装和测试各种服务。
The first option I considered was a free VPS from Google Cloud.
我最先考虑的方案,是 Google Cloud 提供的免费云服务器。
A friend recommended it to me because it appeared to offer enough resources for a small personal service without requiring a monthly payment.
这是我同学推荐给我的方案,因为它看起来能够免费提供足以运行小型个人服务的资源。
For someone who had never rented a server before, “free” was naturally attractive.
对于一个从来没有租用过服务器的人来说,“免费”当然很有吸引力。
But the application process was not as simple as creating an ordinary online account.
但它的申请过程并不像注册普通网络账户那样简单。
There were account checks, payment verification, regional restrictions, and the possibility that the free resources might not remain available in the way I expected.
其中涉及账户审核、付款验证、地区限制,而且免费资源也未必能够按照我预期的方式长期使用。
Even if I successfully obtained the server, I did not think it was a reliable long-term plan.
即使能够顺利申请下来,我也不认为它是一套适合长期依赖的方案。
A free service can change its rules, reduce its resources, or require a different payment method later.
免费服务随时可能修改规则、缩减资源,或者在之后要求使用其他付款方式。
I did not want my first server to depend entirely on whether I could continue qualifying for a promotional plan.
我不希望自己的第一台服务器,完全依赖于自己能否持续满足某个优惠计划的条件。
Payment was another practical problem.
付款也是一个很现实的问题。
At the time, the money I could use conveniently was mainly in RMB and Canadian dollars.
当时我能够方便使用的资金,主要只有人民币和加元。
Many international cloud platforms expected payment methods, billing addresses, or verification procedures that were inconvenient for me.
不少海外云平台需要特定的付款方式、账单地址或者身份验证流程,对我来说并不方便。
The server itself might have been cheap, but getting through the account and payment system was already becoming a separate project.
服务器本身可能并不贵,但仅仅通过账户和支付验证,似乎就已经变成了另一个项目。
I wanted to learn how to use a VPS.
我想学习的是如何使用 VPS。
I did not want to spend most of my time trying to prove to a cloud platform that I was allowed to pay it.
我不想把大部分时间都花在向云平台证明自己有资格给它付款上。
So I began looking for a provider that accepted payment methods I could actually use.
于是,我开始寻找一家能够接受我现有付款方式的服务商。
I eventually found a VPS sold by a Chinese company, with the server itself located in Japan.
最后,我找到了一家中国公司销售的 VPS,而服务器的实际节点位于日本。
This arrangement was much easier for me.
这种方式对我来说方便得多。
The purchasing process was familiar, the price was listed in RMB, and I did not need to deal with a complicated overseas billing system.
购买流程更加熟悉,价格直接以人民币结算,也不需要处理复杂的海外付款系统。
The VPS cost roughly 30 RMB per month.
这台 VPS 每月的费用大约是 30 元。
It was not free, but the price was low enough that I could treat it as a real service rather than a temporary trial.
它虽然不是免费的,但价格足够低,我可以把它当作一项真正的长期服务,而不是随时可能失效的试用资源。
Paying a small fixed amount also made the relationship much clearer.
支付一笔固定的小额费用,也让这件事变得更加明确。
I paid for a server, and the provider supplied the resources listed in the plan.
我支付服务器费用,服务商则按照套餐提供对应的资源。
There was no need to wonder whether I would lose access because a free quota or promotional rule had changed.
我不需要担心免费额度或者优惠规则变化之后,服务器会突然无法继续使用。
I chose a Japan location mainly because of distance and latency.
我选择日本节点,主要是考虑距离和延迟。
Compared with servers located in Europe or North America, Japan was geographically closer to China.
与位于欧洲或者北美的服务器相比,日本在地理位置上距离中国更近。
I expected that shorter distance to provide a more usable connection for daily access.
我希望更近的距离能够带来更适合日常使用的网络连接。
The plan did not have especially high bandwidth.
这项套餐的带宽并不算高。
But for one person experimenting with a small server, it looked sufficient.
但对于一个人测试和学习小型服务器来说,它看起来已经足够。
My goal was not to serve hundreds of users or transfer enormous files.
我的目标并不是同时服务几百名用户,也不是传输规模庞大的文件。
I only needed a stable environment where I could connect through SSH, install software, edit configuration files, and see the results myself.
我只需要一个稳定的环境,让我可以通过 SSH 连接、安装软件、修改配置,并亲自观察操作结果。
After completing the purchase, I received a public IP address, a root account, and the information needed to connect to the server.
完成购买之后,我得到了公网 IP、root 账户以及连接服务器所需的信息。
For the first time, I was responsible for a remote Linux machine.
这是我第一次真正负责一台远程 Linux 机器。
The server did not come with a graphical desktop.
服务器并没有提供图形化桌面。
There were no familiar windows, buttons, or installation wizards.
没有熟悉的窗口、按钮,也没有一步一步引导操作的安装程序。
There was only a terminal and a command prompt waiting for instructions.
屏幕上只有终端,以及等待输入命令的提示符。
My first goal was to deploy Hysteria.
我的第一个目标,是在这台服务器上部署 Hysteria。
I wanted to understand whether I could turn a newly purchased VPS into a network service that I could actually use.
我想知道,自己能否把一台刚购买的 VPS,变成一项真正能够使用的网络服务。
On paper, the process looked simple.
从文字步骤来看,整个过程似乎很简单。
Install the program.
安装程序。
Create a configuration file.
创建配置文件。
Prepare the certificate.
准备证书。
Start the service.
启动服务。
But operating a real server made every small detail matter.
但真正操作服务器之后,每一个细节都会产生实际影响。
A wrong directory could make the configuration disappear from the service's perspective.
目录写错,服务就可能根本找不到配置。
A closed port could make a correctly running program unreachable.
端口没有开放,即使程序正常运行,外部设备也无法连接。
An incorrect permission could prevent the service from reading a file that was clearly visible to me.
权限设置错误时,即使我能够看到文件,服务进程也可能无法读取。
At first, I chose to use a self-signed certificate.
最开始,我选择使用自签名证书。
It was not the most polished solution, but it allowed me to begin without immediately adding domain and public certificate requirements.
这并不是最完整的方案,但它让我可以先开始运行服务,而不必立刻处理域名和公共证书申请。
The configuration included the listening port, TLS certificate paths, authentication information, and other basic service settings.
配置文件中包括监听端口、TLS 证书路径、认证信息以及其他基础服务设置。
Each setting introduced a concept that I had previously only seen in guides.
每一项设置,都对应着一个我以前只在教程里见过的概念。
What did it mean for a program to listen on a port?
一个程序“监听端口”究竟意味着什么?
Why were the certificate and private key stored separately?
为什么证书和私钥需要分别保存?
How did Linux decide which user a service should run as?
Linux 如何决定一个服务应该以哪个用户身份运行?
How could a service start automatically after the server rebooted?
服务器重启之后,服务又怎样才能自动启动?
The first major problem appeared when Hysteria failed to read the private key.
第一个比较明显的问题,出现在 Hysteria 无法读取私钥时。
The file existed.
文件确实存在。
The path looked correct.
配置中的路径看起来也没有错误。
But the service still returned a permission error.
但服务依然返回了权限错误。
This was when I began to understand that Linux permissions were not a decorative property attached to a file.
也是在这个时候,我开始明白,Linux 文件权限并不是附着在文件旁边的一项装饰信息。
They directly determined which user and which process could access it.
它会直接决定哪些用户、哪些进程能够访问这个文件。
A file could exist in the correct directory and still be completely unusable to the program that needed it.
一个文件即使位于正确目录,也可能对需要使用它的程序完全不可用。
I adjusted the permissions, restarted the service, and checked its status again.
我修改了权限,重新启动服务,然后再次检查运行状态。
When the service finally stayed active, the result was not visually impressive.
服务最终保持正常运行时,眼前并没有出现什么令人震撼的画面。
There was no colourful interface and no completion animation.
没有彩色界面,也没有完成动画。
There was only a line showing that the service was active.
终端里只有一行信息,显示服务已经处于运行状态。
But that line meant that the program had loaded the configuration, opened the port, read the certificate, and started waiting for connections.
但这一行信息意味着,程序已经成功读取配置、打开端口、加载证书,并开始等待连接。
For the first time, I had installed, configured, diagnosed, and started a real service on a Linux server.
这是我第一次在 Linux 服务器上真正完成一项服务的安装、配置、排错和启动。
I also began using systemd to manage it.
我也开始使用 systemd 管理这项服务。
Starting a service, restarting it, enabling automatic startup, checking its status, and reading its logs gradually became familiar operations.
启动服务、重新启动、设置开机自启、查看运行状态以及读取日志,逐渐变成了一套相对熟悉的操作。
The workflow was simple:
整个流程其实很简单:
Change the configuration.
修改配置。
Restart or reload the service.
重新启动或者加载服务。
Check its status.
检查运行状态。
Read the logs if something failed.
如果出现问题,就查看日志。
Before using a VPS, error messages usually felt like the end of an operation.
在使用 VPS 之前,报错信息往往让我觉得某项操作已经彻底失败。
On Linux, I gradually began treating them as information.
但在 Linux 中,我开始逐渐把报错当作信息。
A useful error could tell me which file could not be opened, which port was already occupied, or which part of the configuration was invalid.
一条有用的报错可以告诉我哪个文件无法读取、哪个端口已经被占用,或者配置文件的哪一部分无效。
The system was not refusing to explain itself.
系统并不是拒绝解释问题。
I simply needed to learn how to read what it was telling me.
我只是需要学会理解它提供的信息。
I still rely heavily on existing guides and commands written by other people.
我现在仍然很依赖现有教程,以及别人已经写好的命令。
I do not understand every parameter before using it.
在执行一条命令之前,我也不一定能够理解其中的每一个参数。
That is not ideal, but having a real server makes the learning process much more concrete.
这并不是最理想的状态,但拥有一台真实服务器之后,学习过程变得具体了很多。
A firewall rule immediately changes whether a connection succeeds.
一条防火墙规则,会立刻改变连接能否成功。
A wrong path immediately prevents a service from starting.
一条错误路径,会直接导致服务无法启动。
A permission change immediately affects whether a program can read its files.
一次权限修改,也会直接影响程序能否读取文件。
The result of every decision is visible.
每一次操作的结果都能够被观察到。
This Japan VPS is not powerful.
这台日本 VPS 的性能并不强。
Its bandwidth is limited, and it is only intended for a small amount of personal traffic.
它的带宽有限,也只适合承载少量个人流量。
But those limitations are acceptable for my first server.
但对于我的第一台服务器来说,这些限制完全可以接受。
I do not need the fastest processor or the largest memory allocation.
我不需要最快的处理器,也不需要很大的内存容量。
I need a machine that remains online and gives me permission to make mistakes.
我需要的是一台能够保持在线,同时允许我不断犯错和修正的机器。
Google's free VPS might have reduced the initial cost.
Google 的免费 VPS 或许能够进一步降低最初的成本。
But the application, payment verification, and uncertainty made it less suitable for what I wanted.
但申请流程、付款验证以及长期使用的不确定性,让它并不适合我现在的需求。
The Chinese provider's Japan VPS is not free, but it is simple to purchase, easy to renew with RMB, and clear about what I am paying for.
这家中国公司销售的日本 VPS 虽然并不免费,但购买流程简单,可以直接使用人民币续费,我也清楚自己究竟购买了什么。
For roughly 30 RMB per month, I now have a public Linux server that I can control.
每月大约 30 元,我获得了一台拥有公网地址、能够由自己控制的 Linux 服务器。
It is a small machine.
它只是一台配置很小的机器。
But it is enough for me to begin.
但它已经足够让我开始。