Forum Moderators: phranque
I currently have a hotlink script that depends on symlinks and I would like to offset some of the server load by redirecting the symlinks to a remote server.
Is this possible?
You might want to send a sticky-mail to the forum moderator to have this post moved over to the Linux, Unix, and *nix like Operating Systems [webmasterworld.com] forum, where you're more likely to get a definitive answer.
Are the two servers on the same network or are they truly "remote" from each other? If they are on the same network, you can use NFS to link them together, then a symlink should work if you mount the second server's drive on the first. If the servers are not networked and you are looking to use a VPN or other, then I'm not sure that any performance gain won't be wiped out by the need to make the remote connection, even if you get the symlink to work.
Is this possible?
The longer answer, it depends on what exactly you're trying to do.
If all you want to do is redirect some queries to somewhere else, Apache provides all sorts of ways to do this. One of them is mod_rewrite. mod_rewrite can accept a number of conditions, one of which is if a file is a symbolic link.
If what you want to say is "if the requested file is a symbolic link, instead of returning the file the link points to, redirect the client to this URL on another server", then yes you can do that. (From reading the docs, not that I've tried this.) Have a look at
[httpd.apache.org...]
and the bit that says
'-l' (is symbolic link)
Treats the TestString as a pathname and tests if it exists and is a symbolic link.
And welcome to WebmasterWorld.