共计 2052 个字符,预计需要花费 6 分钟才能阅读完成。
OpenLiteSpeed 是 LiteSpeed 的开源版本,是一个强大的、轻量级开源 HTTP web 服务器,由 LightSpeed 技术在 GPLv3.0 许可下开发。
系统环境
CentOS 8
配置 OpenLiteSpeed 软件源
首先将 OpenLiteSpeed 软件源添加到 CentOS 8:
[root@localhost ~]# rpm -ivh http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el8.noarch.rpm

更新软件源:
[root@localhost ~]# dnf makecache
从 OpenLiteSpeed 软件源安装 PHP
在这一步中,我们将使用俗称 LSPHP 的 OpenLiteSpeed 软件源安装 PHP 7.4. 但是在此之前,请确保使用以下命令添加了 epel 软件源:
[root@localhost ~]# dnf install -y epel-release
安装 epel 软件源后,下面安装 LSPHP:
[root@localhost ~]# dnf install -y lsphp74 lsphp74-mysqlnd lsphp74-process lsphp74-mbstring lsphp74-mcrypt lsphp74-gd lsphp74-opcache lsphp74-bcmath lsphp74-pdo lsphp74-common lsphp74-xml

使用上述 dnf 命令成功安装 PHP 软件包后,接下来我们安装 MariaDB 数据库服务器。
安装 MariaDB 数据库
运行下面命令安装 mariadb-server:
[root@localhost ~]# dnf install -y mariadb mariadb-server
安装完成之后,启用 mariadb 服务的开机启动,并启动服务:
[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl start mariadb
运行以下 systemctl 命令以检查 mariadb 服务的状态,
[root@localhost ~]# systemctl status mariadb

默认情况下,MariaDB 并不安全,因此,我们需要采取一些额外的步骤来保护 MariaDB。运行以下步骤:
[root@localhost ~]# mysql_secure_installation
首先需要为 root 用户设置密码

对于其他的提示。只需输入“Y”以执行最佳实践设置:

安装 OpenLiteSpeed
使用 dnf 包管理器来安装 OpenLiteSpeed:
[root@localhost ~]# dnf install -y openlitespeed
查看以下 web 服务是否启动,一般情况夏安装完成自动启动:
[root@localhost ~]# systemctl status lsws

Web 服务侦听两个端口:8088 和 7080. 端口 8088 用于演示,而端口 7080 是管理页面。
可以使用 netstat 命令确认 Web 服务器正在侦听的端口,如下所示:
[root@localhost ~]# netstat -tlunp

如果防火墙正在运行,需要打开下面的端口:
[root@localhost ~]# firewall-cmd –permanent –add-port=8088/tcp
success
[root@localhost ~]# firewall-cmd –permanent –add-port=7080/tcp
success
[root@localhost ~]# firewall-cmd –reload
success

更改默认管理密码
默认情况下,管理员的密码设置为 123456. 我们需要更改此密码为一个非常可靠的密码。更好的是,可以设置一个其他用户为管理用户,运行下面的脚本来修改管理员配置:
[root@localhost ~]# /usr/local/lsws/admin/misc/admpass.sh

访问 OpenLiteSpeed 的 web 页面
如果要访问 OpeLiteSpeed Web 服务器的默认页面,输入服务器的 ip 地址 +8088 端口。

如果要访问管理页面,输入服务器的 ip 地址 +7080 端口。账号密码为上一步设置的管理员


到此就安装结束啦!
总结
OpenLiteSpeed 是 LiteSpeed 的开源版本,是一个强大的、轻量级开源 HTTP web 服务器,由 LightSpeed 技术在 GPLv3.0 许可下开发。
你的工作,由 AI 赋能!🔥
还在为文案、脚本卡壳、做视频、写代码、设计图片灵感枯竭而烦恼吗?🤯
板板 AI,你的工作好帮手!
一键生成 各种文案、脚本、图片、视频、代码、报告,轻松应对各种工作 / 营销需求!
现在注册体验,即可获得:
- 🎁 30 积分基础模型余额
- 🎁 3 积分高级模型余额
- 🎁 3 积分绘画余额
还不快来试试?
点击链接,开启你的 AI 创作之旅!>>>https://www.banbanai.cn
板板 AI,让你的工作效果发挥无限可能! 🚀
