如何安装和配置 OpenLiteSpeed、php 和 MySQL Fedora

在本教程中,我们将安装和配置 OpenLiteSpeed Web 服务器、PHP 和 MySQL 数据库服务器 Fedora. OpenLiteSpeed 是 LiteSpeed 网络服务器的免费开源版本。 这是最好的之一 Apache Web 服务器替代方案。 它带有 apache 重写规则支持,GUI admin 控制面板和内置缓存支持。 对于本教程,我正在使用 Fedora 31.

安装 OpenLiteSpeed Web 服务器 Fedora:

打开您的终端(ctrl+alt+T)并运行此更新命令并更新您的 Fedora 系统完全第一。

sudo dnf update

Enter 你的 Fedora 用户密码。

然后安装 使用以下命令的网络服务包。 这为 NIS 服务提供了公共客户端接口。

sudo dnf install libnsl -y

如果需要,请输入您的 Fedora 密码。

之后您需要在防火墙中启动并配置 SSH、HTTP、HTTPS 和 7080、8088 端口 Fedora. 您可以使用此命令启动它。

sudo systemctl start firewalld

然后使用以下命令一一启用服务和端口。

启用 SSH:

sudo firewall-cmd --permanent --add-service=ssh

启用 HTTP:

sudo firewall-cmd --permanent --add-service=http

启用 HTTPS:

sudo firewall-cmd --permanent --add-service=https

启用端口 7080:

sudo firewall-cmd --permanent --add-port=7080/tcp

启用端口 8088:

sudo firewall-cmd --permanent --add-port=8088/tcp

之后重新启动防火墙并再次启用防火墙。

sudo firewall-cmd --reload
sudo systemctl enable firewalld

下载 OpenLiteSpeed

下载 OpenLiteSpeed 的最新稳定版本。 目前在写作版本 1.6.12 是稳定版本。 在终端中运行此命令以下载 OpenLiteSpeed。

wget https://openlitespeed.org/packages/openlitespeed-1.6.12.tgz

然后使用此命令提取下载的 openlitespeed-1.6.12.tgz 存档文件。

tar -zxvf openlitespeed-1.6.12.tgz

然后导航到终端中提取的 openlitespeed 文件夹。

cd openlitespeed

然后运行以下命令以启动 OpenLiteSpeed 安装文件。

sudo ./install.sh

然后使用以下命令启动 OpenLiteSpeed Web 服务器。

sudo /usr/local/lsws/bin/lswsctrl start

您可以使用以下方法检查 Web 服务器状态

sudo /usr/local/lsws/bin/lswsctrl status

在您的浏览器中转到以下地址。

https://localhost:8088/

它将显示下面的 OpenLiteSpeed Web 服务器成功页面。