从仓库安装
LiteSpeed 为 RPM 系和 Debian 系发行版维护了官方软件包仓库。这是推荐的安装方式。
AlmaLinux / Rocky Linux 9 安装
Section titled “AlmaLinux / Rocky Linux 9 安装”rpm -Uvh https://rpms.litespeedtech.com/centos/litespeed-repo-1.3-1.el9.noarch.rpm安装 OpenLiteSpeed
Section titled “安装 OpenLiteSpeed”dnf install openlitespeed安装 PHP(可选)
Section titled “安装 PHP(可选)”dnf install lsphp83 lsphp83-common lsphp83-mysqlnd lsphp83-opcacheUbuntu 22.04 / 24.04 安装
Section titled “Ubuntu 22.04 / 24.04 安装”添加仓库并安装
Section titled “添加仓库并安装”wget -O - https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bashapt updateapt install openlitespeed安装 PHP(可选)
Section titled “安装 PHP(可选)”apt install lsphp83 lsphp83-common lsphp83-mysql lsphp83-opcacheDebian 12 安装
Section titled “Debian 12 安装”Debian 使用相同的仓库脚本:
wget -O - https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bashapt updateapt install openlitespeed设置 WebAdmin 密码
Section titled “设置 WebAdmin 密码”安装完成后,为 WebAdmin 管理界面设置管理员密码:
/usr/local/lsws/admin/misc/admpass.sh该脚本会提示输入用户名和密码。凭据存储在 /usr/local/lsws/admin/conf/htpasswd 中。
或者,可以在以下位置找到随机生成的初始密码:
/usr/local/lsws/adminpasswd启动和停止服务器
Section titled “启动和停止服务器”# 启动/usr/local/lsws/bin/lswsctrl start
# 停止/usr/local/lsws/bin/lswsctrl stop
# 重启/usr/local/lsws/bin/lswsctrl restart
# 查看状态/usr/local/lsws/bin/lswsctrl status在使用 systemd 的系统上:
systemctl start lswssystemctl stop lswssystemctl restart lswssystemctl enable lsws # 开机自启访问 WebAdmin 管理界面
Section titled “访问 WebAdmin 管理界面”打开浏览器,访问:
https://your-server-ip:7080接受自签名证书警告,然后使用上面设置的凭据登录。WebAdmin 界面允许您通过图形界面管理监听器、虚拟主机、SSL 和模块。
默认站点在 8088 端口提供服务。打开:
http://your-server-ip:8088您应该能看到 OpenLiteSpeed 的欢迎页面。
如果使用 firewalld(AlmaLinux/Rocky):
firewall-cmd --permanent --add-port=7080/tcpfirewall-cmd --permanent --add-port=80/tcpfirewall-cmd --permanent --add-port=443/tcpfirewall-cmd --reload如果使用 ufw(Ubuntu/Debian):
ufw allow 7080/tcpufw allow 80/tcpufw allow 443/tcp