OpenLiteSpeed是LiteSpeed的开源版本,是一个弱小的、轻量级开源HTTP web服务器,由LightSpeed技术在GPLv3.0许可下开发。
零碎环境
CentOS 8
配置OpenLiteSpeed软件源
首先将OpenLiteSpeed软件源增加到CentOS 8:
[root@localhost ~]# rpm -ivh http://rpms.litespeedtech.com...
如何在CentOS 8中装置OpenLiteSpeed Web服务器如何在CentOS 8中装置OpenLiteSpeed Web服务器
更新软件源:
[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
如何在CentOS 8中装置OpenLiteSpeed Web服务器如何在CentOS 8中装置OpenLiteSpeed Web服务器
应用上述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
如何在CentOS 8中装置OpenLiteSpeed Web服务器如何在CentOS 8中装置OpenLiteSpeed Web服务器
默认状况下,MariaDB并不平安,因而,咱们须要采取一些额定的步骤来爱护MariaDB。运行以下步骤:
[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许可下开发。