我试图在我们的一台CenotOS服务器上整合一些网站文件,我想要创build的设置是这样的,但是我不确定它的实际可能性
我们将有一组所有站点使用的文件:
/home/commonfiles/ public_html/ library/
每个网站目录看起来像这样:
/home/site1/bespoke/ css/ images/
每个“站点”将使用公共文件中的public_html和library文件夹。 符号链接显然会为此工作。 我也想要的是/home/commonfiles/public_html/css指向/home/site1/bespoke/css ,其中site1是绝对链接到/home/commonfiles/public_html/的站点。 我知道它可能创build相对符号链接,但是绝对符号链接可能包含相对符号链接。
我希望这是有道理的,因为我真的很欣赏一些build议
编辑
详细说明,这是我想要的基本结构(如果可能的话)
/home/common /home/common/public /home/common/library /home/site1 /home/site1/public -> /home/common/public /home/site1/library -> /home/common/library /home/site1/bespoke/ /home/site1/bespoke/css /home/site1/bespoke/images /home/site1/public/css -> /home/site1/bespoke/css /home/site1/public/images -> /home/site1/bespoke/images /home/site2 /home/site2/public -> /home/common/public /home/site2/library -> /home/common/library /home/site2/bespoke/ /home/site2/bespoke/css /home/site2/bespoke/images /home/site2/public/css -> /home/site2/bespoke/css /home/site2/public/images -> /home/site2/bespoke/images
我想基本上 – 例如 – /home/site1/public/css -> /home/site1/bespoke/css的映射不一定要用链接来完成,也许这可以通过某种方式在.htaccess中完成。 希望你能看到我想在这里实现。
只是为了增加这一点,这基本上是我想要能够做到的(如果它工作的话):
mkdir test mkdir test/common mkdir test/common/public mkdir test/common/library mkdir test/site1 mkdir test/site2 mkdir test/site1/bespoke mkdir test/site2/bespoke mkdir test/site1/bespoke/css mkdir test/site1/bespoke/images mkdir test/site2/bespoke/css mkdir test/site2/bespoke/images ln -s /home/user/test/common/public test/site1/public ln -s /home/user/test/common/library test/site1/library ln -s /home/user/test/common/public test/site2/public ln -s /home/user/test/common/library test/site2/library cd test/common/public ln -s ../bespoke/css css ln -s ../bespoke/images images
这是不可能的链接
答案是肯定的。 下面的testing可能对您想要做的事情太纠结了,但是可能有助于说明可以做些什么。
$ mkdir test $ mkdir test/a $ mkdir test/a/dir1 $ touch test/a/dir1/file1 $ ln -s /absolute/path/to/test/a test/b $ ls -l test drwxr-xr-x 3 user user 4096 2009-11-13 07:45 a lrwxrwxrwx 1 user user 28 2009-11-13 07:45 b -> /absolute/path/to/test/a $ ls -l test/b drwxr-xr-x 3 user user 4096 2009-11-13 07:45 dir1 $ cd b $ ln -s ../a/dir1 dir2 $ ls -l drwxr-xr-x 3 user user 4096 2009-11-13 07:45 dir1 drwxr-xr-x 3 user user 4096 2009-11-13 07:45 dir2 -> ../a/dir1 $ ls -l dir1 drwxr-xr-x 3 user user 4096 2009-11-13 07:45 file1 $ ls -lH dir2 drwxr-xr-x 3 user user 4096 2009-11-13 07:45 file1 $ cd ../a $ ls -l drwxr-xr-x 3 user user 4096 2009-11-13 07:45 dir1 drwxr-xr-x 3 user user 4096 2009-11-13 07:45 dir2 -> ../a/dir1
最后一项是有趣的。 它基本上是/absolute/path/to/test/a/../a/dir1 。
我在一台Web服务器上安装了多个Wordpress。
我设置了“wp-content”目录(其中包含主题和插件),以便在安装过程中共享:
/var/<site>/wp-content -> /home/common/wp-content /var/<site2>/wp-content -> /home/common/wp-content etc...
这将完成:
cd /var/<site> ln -s wp-content /home/common/wp-content
我在我的/home/common/wp-content目录上设置了rwxrwxrwx这个特殊设备上的rwxrwxrwx 。