如何在CentOS 8中安装OpenLiteSpeed Web服务器

OpenLiteSpeed是LiteSpeed的开源版本,是一个强大的、轻量级开源HTTP web服务器,由LightSpeed技术在GPLv3.0许可下开发。
系统环境
CentOS 8php

配置OpenLiteSpeed软件源
首先将OpenLiteSpeed软件源添加到CentOS 8:mysql

[root@localhost ~]# rpm -ivh http://rpms.litespeedtech.com...
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
更新软件源:web

[root@localhost ~]# dnf makecache
从OpenLiteSpeed软件源安装PHP
在这一步中,咱们将使用俗称LSPHP的OpenLiteSpeed软件源安装PHP 7.4。可是在此以前,请确保使用如下命令添加了epel软件源:sql

[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
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
使用上述dnf命令成功安装PHP软件包后,接下来咱们安装MariaDB数据库服务器。centos

安装MariaDB数据库
运行下面命令安装mariadb-server:安全

[root@localhost ~]# dnf install -y mariadb mariadb-server
安装完成以后,启用mariadb服务的开机启动,并启动服务:服务器

[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl start mariadb
运行如下systemctl命令以检查mariadb服务的状态,php7

[root@localhost ~]# systemctl status mariadb
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
默认状况下,MariaDB并不安全,所以,咱们须要采起一些额外的步骤来保护MariaDB。运行如下步骤:tcp

[root@localhost ~]# mysql_secure_installation
首先须要为root用户设置密码
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
对于其余的提示。只需输入“Y”以执行最佳实践设置:
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器

安装OpenLiteSpeed
使用dnf包管理器来安装OpenLiteSpeed:

[root@localhost ~]# dnf install -y openlitespeed
查看如下web服务是否启动,通常状况夏安装完成自动启动:

[root@localhost ~]# systemctl status lsws
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
Web服务侦听两个端口:8088和7080。端口8088用于演示,而端口7080是管理页面。

可使用netstat命令确认Web服务器正在侦听的端口,以下所示:

[root@localhost ~]# netstat -tlunp
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
若是防火墙正在运行,须要打开下面的端口:

[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
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器

更改默认管理密码
默认状况下,管理员的密码设置为123456,咱们须要更改此密码为一个很是可靠的密码。更好的是,能够设置一个其余用户为管理用户,运行下面的脚原本修改管理员配置:

[root@localhost ~]# /usr/local/lsws/admin/misc/admpass.sh
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器

访问OpenLiteSpeed的web页面
若是要访问OpeLiteSpeed Web服务器的默认页面,输入服务器的ip地址+8088端口。
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
若是要访问管理页面,输入服务器的ip地址+7080端口。帐号密码为上一步设置的管理员
如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器

如何在CentOS 8中安装OpenLiteSpeed Web服务器如何在CentOS 8中安装OpenLiteSpeed Web服务器
到此就安装结束啦!

总结OpenLiteSpeed是LiteSpeed的开源版本,是一个强大的、轻量级开源HTTP web服务器,由LightSpeed技术在GPLv3.0许可下开发。

相关文章
相关标签/搜索