可以通过 Apache 下载文件吗?

use*_*308 5 apache

路径=/var/lib/foo.txt

是否可以配置 Apache,以便有一些 HTTP URL 可以启动该文件的下载以及如何配置? 没有.htaccess文件。

那么那个 URL 会是什么?localhost/var/lib/foo.txt

Pro*_*ock 2

就像在 apache 配置中添加别名指令一样简单。

Alias '/bar' '/path/to/foo'
Run Code Online (Sandbox Code Playgroud)

然后您可以通过类似的方式公开访问该资源http://example.com/bar