Forum Moderators: phranque

Message Too Old, No Replies

Symbolic links for mirror sites?

Is it a good practice to use symbolic links to files in one directory

         

FormosaKing

9:35 am on Jun 22, 2009 (gmt 0)

10+ Year Member



I'm planning to host many mirrors of very similar sites on different domains using apache. Because most of the files will be the same, and will never be changed, I was wondering if it's better to just have a lot of symbolic links pointing to static files kept in one directory. It seems like it saves space, and is convenient, but is it more efficient on resources? Does anyone recommend this?

jdMorgan

2:22 pm on Jun 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The best answer depends on what kind of hosting arrangement you have.

In order to minimize on-going maintenance (of the symlinks, for example), the usual approach is to define "Alias" directory-paths in the server config file, so that all requests for "common files" (for example, scripts in "/cgi-bin") are rewritten to a different, shared, filepath regardless of which host they are requested on. If you do not have the server privileges needed to define Aliases, another option is to use mod_rewrite, but the mod_alias approach is more efficient.

Jim

FormosaKing

2:54 am on Jun 23, 2009 (gmt 0)

10+ Year Member



That's even better. Thanks a lot!