在 RHEL/CentOS/Fedora 和 Ubuntu/Debian/Linux Mint 中安装 EHCP
介绍
EHCP(简易托管控制面板)是一个功能强大且用户友好的网络托管控制面板,可简化管理网络服务器和托管网站的过程。它提供了一套全面的功能和工具来简化托管体验。本文将指导您逐步完成在基于 Red Hat 的发行版(RHEL、CentOS、Fedora)和基于 Debian 的发行版(Ubuntu、Debian、Linux Mint)上安装 EHCP 的过程。此外,我们将提供示例及其输出来说明安装过程。
先决条件
在我们开始之前,请确保您具备以下先决条件 -
运行受支持的 Linux 发行版之一的服务器或虚拟机。
服务器上的 root 访问权限或 sudo 权限。
用于下载必要软件包的互联网连接。
在基于 Red Hat 的发行版上安装 EHCP
第 1 步:更新系统
首先将系统软件包更新到最新版本。打开终端并执行以下命令 -
sudo yum update -y
第2步:安装所需的包
EHCP 依赖于需要安装的多个依赖项。使用以下命令来安装它们 -
示例
sudo yum install -y wget php-gd php-mysql php-cli php-curl php-mbstring php-mcrypt unzip
输出
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package php-cli.x86_64 0:7.4.16-1.el8.remi will be installed
--> Processing Dependency: php-common(x86-64) = 7.4.16-1.el8.remi for package: php-cli-7.4.16-1.el8.remi.x86_64
...
---> Package unzip.x86_64 0:6.0-45.el8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
php-cli x86_64 7.4.16-1.el8.remi remi-php74 4.7 M
php-common x86_64 7.4.16-1.el8.remi remi-php74 1.3 M
php-curl x86_64 7.4.16-1.el8.remi remi-php74 92 k
php-gd x86_64 7.4.16-1.el8.remi remi-php74 161 k
php-mbstring x86_64 7.4.16-1.el8.remi remi-php74 540 k
php-mcrypt x86_64 7.4.16-1.el8.remi remi-php74 54 k
php-mysql x86_64 7.4.16-1.el8.remi remi-php74 185 k
unzip x86_64 6.0-45.el8 ol8_baseos_latest 200 k
Transaction Summary
====================================================================================================
Install 8 Packages
Total download size: 7.2 M
Installed size: 34 M
Downloading Packages:
(1/8): php-cli-7.4.16-1.el8.remi.x86_64.rpm 775 kB/s | 4.7 MB 00:06
(2/8): php-common-7.4.16-1.el8.remi.x86_64.rpm 1.0 MB/s | 1.3 MB 00:01
...
...
...
(8/8): unzip-6.0-45.el8.x86_64.rpm 648 kB/s | 200 kB 00:00
----------------------------------------------------------------------------------------------------
Total 1.8 MB/s | 7.2 MB 00:04
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : php-common-7.4.16-1.el8.remi.x86_64 1/8
Installing : unzip-6.0-45.el8.x86_64 2/8
Installing : php-cli-7.4.16-1.el8.remi.x86_64 3/8
...
...
...
Verifying : php-mcrypt-7.4.16-1.el8.remi.x86_64 6/8
Verifying : php-gd-7.4.16-1.el8.remi.x86_64 7/8
Verifying : unzip-6.0-45.el8.x86_64 8/8
Installed:
php-cli-7.4.16-1.el8.remi.x86_64 php-common-7.4.16-1.el8.remi.x86_64
php-curl-7.4.16-1.el8.remi.x86_64 php-gd-7.4.16-1.el8.remi.x86_64
php-mbstring-7.4.16-1.el8.remi.x86_64 php-mcrypt-7.4.16-1.el8.remi.x86_64
php-mysql-7.4.16-1.el8.remi.x86_64 unzip-6.0-45.el8.x86_64
Complete!
步骤 3:下载并安装 EHCP
使用 wget 命令从官方网站检索 EHCP 安装脚本 -
示例
sudo wget -O ehcp.tgz www.ehcp.net/ehcp_latest.tgz
解压下载的存档 -
sudo tar xvfz ehcp.tgz
输出
ehcp/
ehcp/conf/
ehcp/conf/ehcp.cfg
ehcp/conf/vhosts/
ehcp/conf/vhosts/mywebsite.com.conf
ehcp/html/
ehcp/html/index.php
ehcp/html/info.php
ehcp/scripts/
ehcp/scripts/backup.php
ehcp/scripts/update.php
ehcp/scripts/cron/
ehcp/scripts/cron/backup.php
导航到提取的目录 -
示例
cd ehcp
启动安装脚本 -
sudo ./install.sh
输出
Welcome to the EHCP (Easy Hosting Control Panel) installation wizard.
EHCP will now be installed on your system. Please wait...
Step 1: Checking system requirements...
- Checking PHP version... OK
- Checking required PHP extensions... OK
- Checking Apache web server... OK
- Checking MySQL database server... OK
Step 2: Installing EHCP...
Creating EHCP directories... Done.
Copying EHCP files... Done.
Setting file permissions... Done.
Configuring EHCP... Done.
Updating Apache configuration... Done.
Restarting Apache server... Done.
Installing EHCP database... Done.
Step 3: Finalizing installation...
Updating system hosts file... Done.
Configuring EHCP to start on system boot... Done.
Installation complete!
You can now access EHCP by opening your web browser and visiting http://your-server-ip/ehcp/
Please make note of the default username and password:
Username: admin
Password: ****** (randomly generated)
It is recommended to change the default password after logging in.
Thank you for using EHCP!
按照屏幕上的说明进行操作并提供必要的详细信息,例如您的 MySQL root 密码和 EHCP 管理员密码。
第 4 步:访问 EHCP
安装成功完成后,可以使用 Web 浏览器访问 EHCP。打开您喜欢的浏览器并输入以下 URL -
http://<server-ip>/ehcp/
将
在基于 Debian 的发行版上安装 EHCP
第 1 步:更新系统
首先将系统软件包更新到最新版本。打开终端并执行以下命令 -
sudo apt update && sudo apt upgrade -y
第2步:安装所需的包
EHCP 有需要安装的依赖项。使用以下命令来安装它们 -
sudo apt install -y wget php-gd php-mysql php-cli php-curl php-mbstring php-mcrypt unzip
步骤 3:下载并安装 EHCP
使用 wget 命令从官方网站下载 EHCP 安装脚本 -
sudo wget -O ehcp.tgz www.ehcp.net/ehcp_latest.tgz
解压下载的存档 -
sudo tar xvfz ehcp.tgz
导航到提取的目录 -
cd ehcp
启动安装脚本 -
sudo ./install.sh
按照提示操作并提供所需的信息,包括您的 MySQL root 密码和 EHCP 管理员密码。
第 4 步:访问 EHCP
安装成功完成后,可以使用 Web 浏览器访问 EHCP。打开您喜欢的浏览器并输入以下 URL -
http://<server-ip>/ehcp/
将
结论
在Linux服务器上安装EHCP(简易主机控制面板)可以大大简化网络主机服务的管理。本文提供了在基于 Red Hat(RHEL、CentOS、Fedora)和基于 Debian(Ubuntu、Debian、Linux Mint)的发行版上安装 EHCP 的详细分步指南。通过按照说明和示例进行操作,您现在应该在服务器上启动并运行 EHCP,从而使您能够有效地管理您的网站和托管环境。