HTTrack 是一个免费的开源离线浏览器实用程序,允许您将网站和网页下载到本地存储中,从而有效地创建目标站点的镜像。此镜像可以脱机访问,并且对于各种目的非常有用,例如研究,内容保存甚至站点开发。
在 AlmaLinux 9 上安装 HTTrack
第 1 步。在安装 HTTrack 之前,必须更新软件包存储库以确保您可以访问最新的软件包。打开终端并运行以下命令:
<span class="pln">sudo dnf clean all sudo dnf update</span>
第 2 步。安装所需的依赖项。
HTTrack依赖于某些依赖项才能正常运行。使用以下命令安装它们:
<span class="pln">sudo dnf install wget gcc glibc zlib</span><span class="pun">-</span><span class="pln">devel openssl</span><span class="pun">-</span><span class="pln">devel</span>
第 3 步。在AlmaLinux 9上安装HTTrack。
接下来,您需要下载HTTrack软件包。使用该命令检索它:wget
<span class="pln">wget https</span><span class="pun">:</span><span class="com">//download.httrack.com/cserv.php3?File=httrack.tar.gz</span>
Unpack the downloaded archive using the command:tar
<span class="pln">tar </span><span class="pun">-</span><span class="pln">xvf cserv</span><span class="pun">.</span><span class="pln">php3</span><span class="pun">?</span><span class="typ">File</span><span class="pun">=</span><span class="pln">httrack</span><span class="pun">.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">gz</span>
导航到解压缩的目录:
<span class="pln">cd httrack</span><span class="pun">-*</span>
编译并安装 HTTrack:
<span class="pun">./</span><span class="pln">configure </span><span class="pun">&&</span><span class="pln"> make </span><span class="pun">&&</span><span class="pln"> sudo make install</span>
这一系列命令配置构建、编译源代码并安装 HTTrack。
要确认已成功安装 HTTrack,请运行:
<span class="pln">httrack </span><span class="pun">--</span><span class="pln">version</span>
这应该显示 HTTrack 版本号,指示安装成功。
第 4 步。HTTrack的基本用法。
HTTrack遵循一个简单的命令结构,它使您可以轻松镜像网站。让我们看一个下载网站的示例:
HTTrack 命令的基本结构如下:
<span class="pln">httrack </span><span class="pun">[</span><span class="pln">options</span><span class="pun">]</span> <span class="pun">[</span><span class="pln">URL</span><span class="pun">(</span><span class="pln">s</span><span class="pun">)]</span>
哪里:
options
是各种设置和配置。URL(s)
是您要镜像的网站或页面。
示例:下载网站:
要镜像网站,只需运行以下命令:
<span class="pln">httrack http</span><span class="pun">:</span><span class="com">//example.com</span>
感谢您使用本教程在您的 AlmaLinux 9 系统上安装 HTTrack。有关其他帮助或有用信息,我们建议您查看HTTrack官方网站。