将文件从一个文件夹投影到另一个文件夹

Projecting files from one folder to another


我想在我的本地文件夹中有一部分 apache 配置。

有必要自动创建子域。

是否可以将我本地文件夹中的所有文件投影到 Debian linux 下的 /etc/apche2/sites-available/ 文件夹中?

我。 e.不要为每个新文件创建符号 link,而只是让事情变得简单 8-)

必须是这样的:

LOCAL FOLDER                           SITES-AVAILABLE

f1.conf                                s-a1.conf
f2.conf                                s-a2.conf
f3.conf                                s-a3.conf
                                       f1.conf
                                       f2.conf
                                       f3.conf

提前致谢!

来自man mount

mount --bind olddir newdir

After this call the same contents are accessible in two places. One can also remount a single file (on a single file).

你的情况是:

sudo mount --bind /etc/apche2/sites-available/ ~/my/local/folder/

在执行 mount 之前确保 ~/my/local/folder/ 为空。