Forum Moderators: phranque

Message Too Old, No Replies

Symlink to remote server

         

Vertex

2:27 am on Jul 19, 2004 (gmt 0)



This may be more of a general linux question but maybe you guys can help me. I was wondering if it is possible to create a symlink on one server to point to a file on another server.

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?

encyclo

11:01 am on Jul 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Vertex!

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.

py9jmas

11:46 am on Jul 19, 2004 (gmt 0)

10+ Year Member



Is this possible?

In a word, no.

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.