博客

服务器

运维你自己的服务器:VPS、VDS 和独立服务器,AlmaLinux 系统管理、防火墙配置,以及保障服务器安全的常用命令。

How To Disable Firewalld On AlmaLinux A Step-By-Step Guide

Firewalld is the default firewall management tool on AlmaLinux, providing a dynamic way to manage firewall settings with support for network zones. While it's a crucial component for system security, there are scenarios where you might need to disable it temporarily or permanently. This guide will walk you through the steps to disable Firewalld, along with important considerations to keep your system secure.

1 分钟阅读

Mastering Linux Server Commands Similarities and Differences Across Distributions

Linux is one of the most powerful and versatile operating systems, widely used for both personal computing and server management. Although different Linux distributions (or "distros") may seem distinct, many of their basic operations remain consistent across platforms. However, there are also key differences, especially when it comes to package management and system administration. In this article, we’ll explore both the commonalities and distinctions between Linux distributions, helping users

1 分钟阅读

How To Disable The Firewall On AlmaLinux 9 Step-By-Step Guide

Firewalls play a crucial role in protecting systems by monitoring and controlling incoming and outgoing network traffic. However, there are scenarios where disabling the firewall may be necessary, such as when troubleshooting or during specific system configurations. In this article, we will walk you through the steps to disable a firewall. This is a general guide that can be applied to various systems, offering a clear, professional explanation suitable for a wide audience.

1 分钟阅读

How To Check Your Almalinux Version 5 Easy Methods For Servers

Knowing the exact version of your Linux system can be crucial for troubleshooting, managing software, or simply staying informed about your system's capabilities. There are several methods you can use to check the version and distribution of Linux you're running. This article will walk you through the most common ways to gather this information efficiently.

1 分钟阅读

How to Enable Short Open Tags in PHP 8.1 and Locate Your php.ini File

PHP developers often need to optimize their code to ensure compatibility with different server environments. One common feature in earlier versions of PHP is the use of short open tags (<? ), which are a shorthand for the standard PHP open tags (<?php ). However, with the release of PHP 8.0, the use of short open tags has been deprecated. Despite this, in certain scenarios, developers may want to enable them manually for legacy code or personal preference. This article outlines a step-by-step

1 分钟阅读

Install and Manage Firewalls in AlmaLinux 9

A firewall is a security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. Firewalls act as a barrier between a trusted internal network and untrusted external networks, such as the internet. They are critical for preventing unauthorized access while allowing legitimate traffic to pass through. In this tutorial, we will walk you through the process of understanding, installing, configuring, and troubleshooting firewalls on AlmaLinux 9.

1 分钟阅读

Installing and Managing NetworkManager in AlmaLinux 9

NetworkManager is an essential tool for managing network connections on AlmaLinux 9. It simplifies the process of configuring, maintaining, and troubleshooting network connections. In this guide, we will walk you through how to install NetworkManager, manage it (start, restart, and stop), troubleshoot common issues, and provide essential commands to ensure that your network is running smoothly.

1 分钟阅读

aaPanel vs Webmin/Virtualmin Comprehensive Feature Comparison

As a hosting provider, selecting the right control panel is crucial for ensuring smooth server management and optimal performance. In this detailed comparison, we will explore the features, strengths, and weaknesses of two popular control panels: aaPanel and Webmin/Virtualmin. This guide will help you make an informed decision about which panel is best suited for your hosting environment.

1 分钟阅读

Understanding and Securing Portmapper (rpcbind) Services on Your Server and How to Disabe

In the world of server administration, maintaining security is a paramount responsibility. Ensuring that your server is safeguarded against potential vulnerabilities can prevent a wide range of malicious activities, such as Distributed Denial of Service (DDoS) attacks, unauthorized access, and data breaches. One of the potential vulnerabilities that system administrators might encounter is the Portmapper service, also known as rpcbind. This article will delve into what the Portmapper service

1 分钟阅读

What Are Dedicated Servers

Dedicated servers are among the most important technologies in the field of website hosting and business applications. These servers provide high performance and superior security compared to other options such as shared or virtual servers. In this article, we will cover all the information related to dedicated servers, including the definition, benefits, how they work, and their uses, with a comparison to other available options in the market.

1 分钟阅读

What is Virtual Private Servers (VPS)

Virtual Private Servers (VPS) are an excellent solution for companies and individuals who need dedicated server resources without the significant investment in a standalone physical server. In this detailed article, we will cover everything you need to know about VPS, from definition and features to uses and frequently asked questions.

1 分钟阅读

What Are Virtual Dedicated Servers (VDS)

Virtual Dedicated Servers (VDS) are modern technologies that allow users to benefit from the features of dedicated servers but at a lower cost and higher flexibility. In this article, we will cover everything related to virtual dedicated servers in terms of definition, benefits, how they work, and comparison with other technologies.

1 分钟阅读

关于此主题的常见问题

针对读者关于此主题最常提出的问题,给出简明清晰的解答。

网站托管中的服务器是什么?

网站托管中的服务器是一台始终连接互联网的计算机,按访客的请求提供网站、应用、邮件或数据。它运行着操作系统(通常是 Linux),以及 Nginx 或 Apache 等 Web 服务器软件。主机服务商把服务器放在电力稳定、网络高速的数据中心中运行。

什么是 VPS 服务器?

VPS 即虚拟专用服务器,是运行在一台高性能物理服务器上的私有虚拟机,这台物理服务器由多位 VPS 用户共享。每台 VPS 都有自己的操作系统、独立的资源和完整的管理员权限。与共享主机相比,VPS 能提供大得多的控制权。

VPS 和 VDS 有什么区别?

VPS 的物理服务器处理器核心由多位用户共享,而 VDS 即虚拟独享服务器,会为单个客户专门保留特定的核心和内存。因此 VDS 在高负载下性能更加稳定。两者都以虚拟机形式运行,并提供完整的管理员权限。

什么是独立服务器?

独立服务器是整台出租给一位客户的物理机器,其全部处理器、内存和硬盘都专供该客户使用。它适合大型网站、繁重的数据库,以及需要极致性能或严格隔离的业务。独立服务器对管理技能的要求也最高。

什么时候应该从共享主机升级到 VPS?

当网站在流量高峰时变慢、触及资源上限,或需要共享主机不允许安装的软件时,就该从共享主机升级到 VPS 了。需要自定义服务器配置的网站也适合使用 VPS。不断成长的网店和 Web 应用,往往最先遇到这种情况。

对成长中的企业来说,VPS 和独立服务器哪个更好?

对大多数成长中的企业来说,VPS 更好,因为它灵活且易于升级;而独立服务器更适合需要整台机器、负载重且稳定的业务。许多公司先从 VPS 起步,之后再迁移到独立硬件上。具体选择取决于流量、数据规模和性能需求。

AlmaLinux 是什么?

AlmaLinux 是一款由社区维护的免费 Linux 发行版,与 Red Hat Enterprise Linux 二进制兼容。在 CentOS Linux 停止维护之后,它作为稳定的替代品被广泛用于服务器。AlmaLinux 的每个大版本都会获得长期的安全更新。

AlmaLinux 为什么是服务器的热门选择?

AlmaLinux 之所以成为服务器的热门选择,是因为它稳定、免费、与 Red Hat Enterprise Linux 兼容,并且能获得多年的安全更新支持。许多主机控制面板都支持 AlmaLinux。熟悉 CentOS 的管理员会发现,管理 AlmaLinux 几乎没有任何区别。

如何用 SSH 连接 Linux 服务器?

用 SSH 连接 Linux 服务器,只需在终端中运行 ssh user@server-address 这样的命令,然后输入密码或使用密钥登录。SSH 会对整个会话进行加密。Windows 的终端中也自带 SSH 客户端。

为什么应该用 SSH 密钥代替密码?

应该用 SSH 密钥代替密码,因为密钥几乎不可能被猜中,能阻止暴力破解登录。私钥保存在用户自己的电脑上,只有公钥放在服务器上。确认密钥登录正常后,就可以彻底关闭密码登录。

如何保护一台新的 Linux 服务器?

保护一台新的 Linux 服务器,要安装所有更新、创建一个拥有 sudo 权限的普通用户、使用 SSH 密钥、禁用 root 登录和密码登录,并启用只开放必要端口的防火墙。Fail2ban 等工具可以封锁反复登录失败的来源。坚持定期更新和备份,才能让服务器长期保持安全。

Linux 服务器上的防火墙是什么?

Linux 服务器上的防火墙是一组规则,按端口、协议和地址允许或阻止网络流量。它会关闭所有服务,只开放需要对外公开的部分,例如网站和 SSH。在 AlmaLinux 上,常用的防火墙工具是 firewalld。

如何在 AlmaLinux 上用 firewalld 开放端口?

在 AlmaLinux 上用 firewalld 开放端口,先运行 firewall-cmd --permanent --add-port=8080/tcp,再运行 firewall-cmd --reload 使其生效。常见服务可以直接按名称开放,例如 --add-service=https。运行 firewall-cmd --list-all 可以查看当前的规则。

如何在 AlmaLinux 上更新软件包?

在 AlmaLinux 上用 sudo dnf update 命令更新软件包,它会从已配置的软件源下载并安装最新版本。更新内核后需要重启服务器。安装 dnf-automatic 软件包,可以设置自动安装安全更新。

每个服务器管理员都应该掌握哪些 Linux 命令?

每个服务器管理员都应掌握 ls、cd、cp、mv、rm、nano 或 vim、systemctl、journalctl、df、free、top、ss、chmod 和 chown 等命令。它们涵盖了文件、服务、日志、磁盘空间、内存、进程、网络端口和权限管理。掌握这些命令,就能应对大部分日常服务器工作。

如何查看 Linux 服务器的磁盘空间和内存?

在 Linux 服务器上用 df -h 查看磁盘空间,用 free -h 查看内存,两者都会以易读的单位显示大小。du -sh 命令可以显示某个文件夹占用了多少空间。运行 top 或 htop,可以看到哪些进程正在占用内存和处理器。

如何重启 Linux 服务器上的服务?

重启 Linux 服务器上的服务,使用 sudo systemctl restart 加上服务名称,例如 nginx。systemctl status 命令会显示服务是否正在运行,以及最近的几行日志。如果服务支持,用 reload 代替 restart 可以在不断开连接的情况下应用新配置。

Linux 服务器的日志文件在哪里?

Linux 服务器的日志文件大多保存在 /var/log 目录下,而 systemd 服务的日志写入日志系统,用 journalctl 查看。Nginx 等 Web 服务器会在 /var/log 下写入各自的访问日志和错误日志。出现故障时,查看日志是第一步。

Fail2ban 是什么,为什么要在服务器上安装它?

Fail2ban 是一个监控服务器日志的工具,会临时封锁登录失败次数过多的 IP 地址。它能阻止针对 SSH 和其他服务的自动化密码猜测攻击。Fail2ban 与防火墙配合工作,设置好之后几乎不需要维护。

服务器应该如何备份?

服务器应按计划自动备份,并把备份副本保存在与服务器不同的地点。备份应涵盖文件、数据库和配置。定期进行恢复测试,才能证明备份真正可用。

什么是 root 用户,应该用 root 登录吗?

root 用户是 Linux 的管理员账户,对整台服务器拥有不受限制的权限。不建议直接以 root 登录,因为一次失误或一个被盗的密码就会影响一切。日常工作使用拥有 sudo 权限的普通用户更加安全。

如何监控服务器的在线时间和性能?

监控服务器的在线时间和性能,要使用能跟踪处理器、内存、磁盘和网络使用情况,并在出现问题时发出警报的工具。外部在线检测能确认网站从外部是否可以访问。观察长期趋势,可以看出服务器何时需要更多资源。

服务器在线率 99.9% 是什么意思?

服务器在线率 99.9% 意味着在 30 天的一个月里,服务器预计除了大约 43 分钟之外都可以正常访问。在线率保证是主机服务协议中衡量可靠性的指标。计划内的维护时间是否计入这个数字,因服务商而异。

应该选择托管型服务器还是非托管型服务器?

如果公司内部没有服务器管理员,托管型服务器是更好的选择,因为更新、安全和监控都由服务商负责。非托管型服务器适合具备 Linux 技能、希望完全掌控服务器的团队。具体选择取决于可投入的时间和专业能力。

Hostrena 提供 VPS、VDS 和独立服务器吗?

Linkysoft 旗下的主机品牌 Hostrena 提供 VPS 服务器、保留专属核心和内存的 VDS 服务器、独立服务器以及 AI GPU 服务器。客户可以选择位于北美、欧洲或亚太地区的数据中心,享有 99.9% 在线率保证,并有工程师 7×24 小时回复技术支持工单。Hostrena 的工程师还会免费为客户迁移现有网站或整台服务器。