OpenLiteSpeed 是一个开源的高性能 Web 服务器,旨在有效地处理大量流量。它由LiteSpeed Technologies开发,该公司还提供具有附加功能的商业版服务器软件。与Apache和Nginx相比,OpenLiteSpeed以其速度和性能而闻名。此外,它还提供了一个基于 Web 的界面,可轻松管理虚拟主机、模块和网站。
在 Rocky Linux 9 上安装 OpenLiteSpeed
第 1 步。第一步是将系统更新到最新版本的软件包列表。为此,请运行以下命令:
<span class="pln">sudo dnf check</span><span class="pun">-</span><span class="pln">update sudo dnf install epel</span><span class="pun">-</span><span class="pln">release sudo dnf install http</span><span class="pun">:</span><span class="com">//rpms.remirepo.net/enterprise/remi-release-9.rpm</span>
第 2 步。在 Rocky Linux 9 上安装 OpenLiteSpeed。
默认情况下,OpenLiteSpeed 在默认的 Rocky Linux 9 AppStream 存储库中不可用。现在我们将OpenLiteSpeed存储库添加到您的系统中:
<span class="pln">sudo rpm </span><span class="pun">-</span><span class="pln">ivh https</span><span class="pun">:</span><span class="com">//rpms.litespeedtech.com/centos/9/update/x86_64/RPMS/openlitespeed-1.7.16-3.el9.x86_64.rpm</span>
然后,安装 OpenLiteSpeed 和所需的依赖项:
<span class="pln">sudo dnf install openlitespeed</span>
安装后,使用以下命令启动 OpenLiteSpeed 服务并使其能够在启动时启动:
<span class="pln">sudo systemctl start lsws sudo systemctl enable lsws</span>
您可以使用以下命令检查OpenLiteSpeed的状态:
<span class="pln">sudo systemctl status lsws</span>
第 3 步。设置 OpenLiteSpeed 管理员密码。
现在设置用于登录OpenLiteSpeed管理员UI的管理员密码:
<span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">lsws</span><span class="pun">/</span><span class="pln">admin</span><span class="pun">/</span><span class="pln">misc</span><span class="pun">/</span><span class="pln">admpass</span><span class="pun">.</span><span class="pln">sh</span>
出现提示时,提供用户名和强密码。请记住此信息,因为您稍后需要它才能登录到管理面板:
<span class="typ">Please</span><span class="pln"> specify the user name </span><span class="kwd">of</span><span class="pln"> administrator</span><span class="pun">.</span> <span class="typ">This</span> <span class="kwd">is</span><span class="pln"> the user name required to login the administration </span><span class="typ">Web</span> <span class="kwd">interface</span><span class="pun">.</span> <span class="typ">User</span><span class="pln"> name </span><span class="pun">[</span><span class="pln">admin</span><span class="pun">]:</span><span class="pln"> admin </span><span class="typ">Please</span><span class="pln"> specify the administrator</span><span class="str">'s password. This is the password required to login the administration Web interface. Password: Retype password: Administrator'</span><span class="pln">s username</span><span class="pun">/</span><span class="pln">password </span><span class="kwd">is</span><span class="pln"> updated successfully</span><span class="pun">!</span>
第 4 步。配置防火墙。
若要使页面向公众开放,必须使用以下命令编辑防火墙规则以允许 Web 服务器上的 7080 和 8088 请求:
<span class="pln">sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">zone</span><span class="pun">=</span><span class="kwd">public</span> <span class="pun">--</span><span class="pln">permanent </span><span class="pun">--</span><span class="kwd">add</span><span class="pun">-</span><span class="pln">port</span><span class="pun">=</span><span class="lit">8088</span><span class="pun">/</span><span class="pln">tcp sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">zone</span><span class="pun">=</span><span class="kwd">public</span> <span class="pun">--</span><span class="pln">permanent </span><span class="pun">--</span><span class="kwd">add</span><span class="pun">-</span><span class="pln">port</span><span class="pun">=</span><span class="lit">7080</span><span class="pun">/</span><span class="pln">tcp sudo firewall</span><span class="pun">-</span><span class="pln">cmd </span><span class="pun">--</span><span class="pln">reload</span>
第8步。访问OpenLiteSpeed Web界面。
成功安装后,打开您的网络浏览器并使用 URL 访问 OpenLiteSpeed 。您应该会看到OpenLiteSpeed登录页面。输入用户名“”和您在安装过程中设置的密码。https://your-IP-address:7080
admin
登录过程完成后,您将被重定向到 OpenLiteSpeed 管理员 Web 界面,如下所示:
感谢您使用本教程在您的 Rocky Linux 9 系统上安装 OpenLiteSpeed Web 服务器。有关其他帮助或有用信息,我们建议您查看OpenLiteSpeed官方网站。