已创建 apt-mirror 但无法从 localhost/ubuntu 浏览

已创建 apt-mirror 但无法从 localhost/ubuntu 浏览

我在 Ubuntu Server 16.04 上创建了一个 apt-mirror,目的是为办公室中的本地 ubuntu 客户端运行离线 apt 服务器。我从主存档中下载了最新的 xenial debs,安装了 apache2,创建了指向目录的符号链接,但当我尝试浏览http://本地主机/ubuntu,我什么也没得到。我可以直接浏览到 localhost 并得到 Apache2 启动页面,但我无法查看存储库子目录。

采取的步骤:

$apt-get install apt-mirror
$su - apt-mirror /etc/apt/mirror.list
$apt-get install apache2
$ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ /var/www/ubuntu

但当我尝试浏览http://127.0.0.1/ubuntu,我收到“未找到”的提示。

有什么建议吗?我遗漏了什么?据我所知,设置 apt-mirror 应该不太难。

答案1

您的链接应直接创建于。在 Ubuntu 14.04 发布之前,/var/www/html/ubuntu默认的 Apache Web 根目录从 更改为/var/www/var/www/html

因此你的链接创建命令应该是:

ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ /var/www/html/ubuntu

进行此更改后可能需要重新启动 apache2 服务。

相关内容