许多用户曾选择宝塔面板及其海外版 aapanel,但由于安全性问题,尤其是被曝出的后门让许多人在使用时感到不安。这促使我决定转向 HestiaCP,这款开源面板不仅提供了更高的安全性,还拥有简洁的用户界面。
然而,在使用 HestiaCP 的过程中,我也遇到了一些 bug。为了帮助其他用户更顺利地使用这个面板,我整理了一些问题及其解决办法,希望能对大家有所帮助。
系统要求
项目 | 最低 | 推荐 |
---|---|---|
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 的要求,有效的主机名必须遵循以下规则:
- 只能使用字母 (a-z)、数字 (0-9)、和中划线 (-)。
- 中划线不能出现在名称的开头或结尾。
- 主机名最长不能超过 63 个字符。
- 主机名不能仅为数字。
一个典型的 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,但是还是要注意一下。
其他错误暂时还没发现,发现的话在这里更新。