许多用户曾选择宝塔面板及其海外版 aapanel,但由于安全性问题,尤其是被曝出的后门让许多人在使用时感到不安。这促使我决定转向 HestiaCP,这款开源面板不仅提供了更高的安全性,还拥有简洁的用户界面。

然而,在使用 HestiaCP 的过程中,我也遇到了一些 bug。为了帮助其他用户更顺利地使用这个面板,我整理了一些问题及其解决办法,希望能对大家有所帮助。

Hestia Control Panel | Open-source web server control panel.
Open-source web server control panel.

系统要求

项目 最低 推荐
CPU 1 核心, 64 位 4 核心
内存 1 GB (不使用 SpamAssassin 和 ClamAV) 4 GB
磁盘 10 GB HDD 40 GB SSD
操作系统 Debian 10, 11 或 12 最新 Debian
Ubuntu 20.04, 22.04 LTS 最新 Ubuntu LTS

开始安装

步骤 1:下载

首先,确保已在系统上安装了 ca-certificate 包 - 可以使用以下命令执行此操作:

apt-get update && apt-get install ca-certificates

下载最新版本的安装脚本:

wget https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install.sh

步骤 2:运行

要开始安装过程,只需运行脚本并按照屏幕上的提示进行操作:

bash hst-install.sh

注意事项:

在安装 HestiaCP 时,会遇到提示是要求输入一个有效的 FQDN(完全限定域名)。根据 RFC 1178 的要求,有效的主机名必须遵循以下规则:

  1. 只能使用字母 (a-z)、数字 (0-9)、和中划线 (-)。
  2. 中划线不能出现在名称的开头或结尾。
  3. 主机名最长不能超过 63 个字符。
  4. 主机名不能仅为数字。

一个典型的 FQDN 格式是:hostname.domain.tld,例如:server1.example.com

解决方法:

  • Hostname: 这是服务器的名字,例如 foxcoo
  • Domain: 这是你的域名,例如 123.com
  • TLD (顶级域名): 这是域名的扩展名,例如 .com

示例输入:

复制代码foxcoo.123.com

确保你使用一个有效的域名,或者使用本地网络的域名设置(如没有公共域名),你也可以使用 .local 作为 TLD,例如:foxcoo.local

这样可以确保符合 RFC 1178 的要求。

安装完成。下面是安装时输出的日志示例,敏感信息已做打码处理。

Would you like to continue with the installation? [Y/N]: y

Please use a valid emailadress (ex. [email protected]).
Please enter admin email address: ******@***.com
Please enter FQDN hostname [Debian-bookworm-latest-amd64-base]: 

Please use a valid hostname according to RFC1178 (ex. hostname.domain.tld).
Please enter FQDN hostname [Debian-bookworm-latest-amd64-base]: ***

Please use a valid hostname according to RFC1178 (ex. hostname.domain.tld).
Please enter FQDN hostname [Debian-bookworm-latest-amd64-base]: ***

Please use a valid hostname according to RFC1178 (ex. hostname.domain.tld).
Please enter FQDN hostname [Debian-bookworm-latest-amd64-base]: ***
Installation backup directory: ***
Installation log file: ***

Adding required repositories to proceed with installation:

[ * ] NGINX
[ * ] PHP
[ * ] Apache2
[ * ] MariaDB
[ * ] Hestia Control Panel

Updating currently installed packages, please wait...\
The installer is now downloading and installing all required packages.
NOTE: This process may take 10 to 15 minutes to complete, please wait... 
Extracting templates from packages: 100%


========================================================================

[ * ] Configuring system settings...
Adding user hestiamail' to group hestia-users' ...
Done.
[ * ] Configuring Hestia Control Panel...
[ * ] Configuring OpenSSL to improve TLS performance...
[ * ] Generating default self-signed SSL certificate...
[ * ] Adding SSL certificate to Hestia Control Panel...
[ * ] Enabling SFTP jail...
[ * ] Creating default admin account...
[ * ] Configuring NGINX...
[ * ] Updating Cloudflare IP Ranges for Nginx...
[ * ] Configuring Apache Web Server...
[ * ] Installing PHP 8.2...
[ * ] Configuring PHP-FPM 8.2...
[ * ] Configuring PHP...
[ * ] Configuring Vsftpd server...
[ * ] Configuring MariaDB database server...
[ * ] Installing phpMyAdmin version v5.2.1...
tar (child): phpMyAdmin-5.2.1-all-languages.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
cp: cannot stat 'phpMyAdmin-5.2.1-all-languages/*': No such file or directory
sed: can't read /usr/share/phpmyadmin/libraries/vendor_config.php: No such file or directory
[ * ] Configuring Bind DNS server...
[ * ] Configuring Exim mail server...
[ * ] Configuring Dovecot POP/IMAP mail server...
[ * ] Installing ClamAV anti-virus definitions... 
[ * ] Configuring SpamAssassin...
[ * ] Configuring fail2ban access monitor...
[ * ] Installing Roundcube...
[ * ] Configuring File Manager...
[ * ] Configuring PHP dependencies...
[ * ] Installing Rclone...
[ * ] Configuring System IP...
[ * ] Installing remaining software updates...
[ * ] Updating configuration files...
[ ! ] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')
[ ! ] Adding missing variable to hestia.conf: DEBUG_MODE ('false')
[ ! ] Adding missing variable to hestia.conf: PLUGIN_APP_INSTALLER ('true')
[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_ENABLE_BACON ('false')
[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_HIDE_SERVICES ('no')
[ ! ] Adding missing variable to hestia.conf: POLICY_SYSTEM_PASSWORD_RESET ('no')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_CHANGE_THEME ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_DELETE_LOGS ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_DETAILS ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_DNS_TEMPLATES ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_EDIT_WEB_TEMPLATES ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_VIEW_LOGS ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_USER_VIEW_SUSPENDED ('no')
[ ! ] Adding missing variable to hestia.conf: PHPMYADMIN_KEY ('')
[ ! ] Adding missing variable to hestia.conf: USE_SERVER_SMTP ('')
[ ! ] Adding missing variable to hestia.conf: SERVER_SMTP_PORT ('')
[ ! ] Adding missing variable to hestia.conf: SERVER_SMTP_SECURITY ('')
[ ! ] Adding missing variable to hestia.conf: SERVER_SMTP_USER ('')
[ ! ] Adding missing variable to hestia.conf: SERVER_SMTP_PASSWD ('')
[ ! ] Adding missing variable to hestia.conf: SERVER_SMTP_ADDR ('')
[ ! ] Adding missing variable to hestia.conf: POLICY_CSRF_STRICTNESS ('')
[ ! ] Adding missing variable to hestia.conf: DNS_CLUSTER_SYSTEM ('hestia')
[ ! ] Adding missing variable to hestia.conf: DISABLE_IP_CHECK ('no')
[ ! ] Adding missing variable to hestia.conf: APP_NAME ('Hestia Control Panel')
[ ! ] Adding missing variable to hestia.conf: FROM_NAME ('')
[ ! ] Adding missing variable to hestia.conf: FROM_EMAIL ('')
[ ! ] Adding missing variable to hestia.conf: SUBJECT_EMAIL ('{{subject}}')
[ ! ] Adding missing variable to hestia.conf: TITLE ('{{page}} - {{hostname}} - {{appname}}')
[ ! ] Adding missing variable to hestia.conf: HIDE_DOCS ('no')
[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_ERROR_DOCUMENTS ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_SYNC_SKELETON ('yes')
[ ! ] Adding missing variable to hestia.conf: POLICY_BACKUP_SUSPENDED_USERS ('no')
[ ! ] Adding missing variable to hestia.conf: DOMAINDIR_WRITABLE ('no')


====================================================================



Congratulations!

You have successfully installed Hestia Control Panel on your server.

Ready to get started? Log in using the following credentials:

        Admin URL:  https://************:8083
        Backup URL: https://***.***.***.***:8083
        Username:   admin
        Password:   ************

Thank you for choosing Hestia Control Panel to power your full stack web server,
we hope that you enjoy using it as much as we do!

Please feel free to contact us at any time if you have any questions,
or if you encounter any bugs or problems:

Documentation:  https://docs.hestiacp.com/
Forum:          https://forum.hestiacp.com/
GitHub:         https://www.github.com/hestiacp/hestiacp

Note: Automatic updates are enabled by default. If you would like to disable them,
please log in and navigate to Server > Updates to turn them off.

Help support the Hestia Control Panel project by donating via PayPal:
https://www.hestiacp.com/donate

--
Sincerely yours,
The Hestia Control Panel development team

Made with love & pride by the open-source community around the world.
[ ! ] IMPORTANT: The system will now reboot to complete the installation process.

注意一下这里,要想通过 Admin URL: https://************:8083 访问,记得设置DNS记录。

错误1:phpMyAdmin无法使用

查看输出的日志可以发现,phpMyAdmin 安装问题可能会影响数据库管理功能,提示如下。具体错误表明安装过程找不到 phpMyAdmin 文件,导致无法解压和复制文件。

[ * ] Installing phpMyAdmin version v5.2.1...
tar (child): phpMyAdmin-5.2.1-all-languages.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
cp: cannot stat 'phpMyAdmin-5.2.1-all-languages/*': No such file or directory
sed: can't read /usr/share/phpmyadmin/libraries/vendor_config.php: No such file or directory

原因是在 Debian 12 上, /etc/phpmyadmin 属于 hestiamail。

改一下权限就好。

chown root:www-data /etc/phpmyadmin/config.inc.php
chmod 640 /etc/phpmyadmin/config.inc.php

然后,重新单独安装一下phpMyAdmin

/usr/local/hestia/install/upgrade/manual/migrate_phpmyadmin.sh

错误2:修改代理模板不生效

比如,修改代理模板之后出现nginx错误,然后修改好模板后再去点击应用,完全不会生效。

这个时候,把模板换成默认或者其他的,然后再切回来就可以生效了。严格意义来讲这个不算bug,但是还是要注意一下。

错误3:添加额外的包

hestiacp目前不支持运行安装脚本来添加/删除额外的包。此功能作者还在咕咕中。

如果在后续需要用到postgresql,那么无解。

所以,强烈建议第一次安装的时候,就全部安装好需要的模块。

选择安装选项的更简单方法是使用官方提供的安装字符串生成器

Install | Hestia Control Panel
Open-source web server control panel.

错误4:Error: Mysql 8 does not support bookworm (Debian 12)

很久很久以前,debian 12还暂时不支持mysql 8.

现在好了,但是hestiacp作者没更新。所以,你只需要打开/root/hst-install-debian.sh

将以下代码注释掉

if [ "$mysql8" = 'yes' ] && [ "$architecture" = 'aarch64' ]; then
	check_result 1 "Mysql 8 does not support ARM64 yet for Debian please use Ubuntu. Unable to continue"
fi
if [ "$mysql8" = 'yes' ] && [ "$release" = '12' ]; then
	check_result 1 "Mysql 8 does not support Bookworm yet for Debian Unable to continue"
fi

就好了。

如果你用的是自定义安装包的命令,那么他会自动覆盖掉hst-install-debian.sh这个文件。

比如你用的是

bash hst-install.sh --proftpd yes --mysql no --mysql8 yes --postgresql yes --sieve yes --quota yes

需要改成

bash hst-install-debian.sh --proftpd yes --mysql no --mysql8 yes --postgresql yes --sieve yes --quota yes

错误5:GPG error: NO_PUBKEY B7B3B788A8D3785C

安装mysql8.0的时候可能会出现这个错误。

找到对应安装文件,比如 hst-install-debian.sh

gpg --no-default-keyring --keyring /usr/share/keyrings/mysql-keyring.gpg --keyserver "${keyserver}" --recv-keys " 467B942D3A79BD29 " > /dev/null 2>&1 && break

替换为

gpg --no-default-keyring --keyring /usr/share/keyrings/mysql-keyring.gpg --keyserver "${keyserver}" --recv-keys " B7B3B788A8D3785C " > /dev/null 2>&1 && break

其他错误暂时还没发现,发现的话在这里更新。

包含的标签:

教程, HestiaCP

最后更新: October 16, 2024