通常我们在Ubuntu 22 运行cPanel官方的脚本时候会报错,提示cPanel & WHM only supports Ubuntu 22.04 on version 118 or greater, 因为脚本默认安装版本是116
要在Ubuntu 22 安装cPanel & WHM的特定版本118,您需要在安装cPanel之前创建一个名为/etc/cpupdate.conf的文件,并在其中指定您想要安装的版本,以下是创建和配置这个文件的步骤:
1. 使用vi文本编辑器打开/etc/cpupdate.conf文件,如果该文件不存在,请创建它,例如:
root@localhost:/# sudo vi /etc/cpupdate.conf
2. 在/etc/cpupdate.conf文件中添加以下内容:
CPANEL=118
RPMUP=daily
SARULESUP=daily
STAGING_DIR=/usr/local/cpanel
UPDATES=daily
这里,CPANEL=118表示您想要安装的cPanel & WHM的版本是1181
3. :wq保存并关闭文件。
4. 现在可以运行官网cPanel的安装脚本了:
cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
cPanel 官网链接:Installation | cPanel & WHM Documentation
5. cPanel & WHM 118 安装完成:
6. 通过 https://IP:2087 即可访问cPanel 页面。(默认的登录信息就是服务器root用户的密码)
请注意:对于Ubuntu 用户,请记得给root用户设置密码,否则cPanel会无法登陆。
root@localhost:/# sudo passwd root
Changing password for the user “root” …
Changing password for “root”.
New UNIX password:
Retype new UNIX password:
info [passwd] internal PURGE root:qcXu8fZ3BCYQ1nCU:create_user_session password_change
passwd: The system has successfully updated all authentication tokens.
The system has updated the password for the following service: system