How do I link directories over a private network?

January 4, 2014 3k views
I've got a question about moving (linking) the /wp-content directory in WordPress to another droplet within my private network. I'd like to somehow create a shortcut that allowed me to simply reference it as a folder, if that is possible. However, I've included the wp-confg.php snipit of code below that is needed in order to move the wp-content folder. Hope you can give me some idea of the best way of going about this move and redirection. Thanks anyone for your feedback and help. ----------- wp-config.php snipit ---------- Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g. define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/blog/wp-content' );
9 Answers
"I've got a question about moving (linking) the /wp-content directory in WordPress to another droplet within my private network."

Out of curiosity, why would you want to do that (never heard of that before)?
Well, moving /wp-content or /wp-content/uploads to another server would take the processing loading of off the master. Of course, I won't know how much until I move it and test is with something like New Relic on both servers. What I don't know, is how much of a load will be created by on the master server to just pass it thru to the other server. What I am trying to prevent is creating an entire separate subdomain, which also can be done. Open to all feedback. Thanks...
Perhaps what I am trying to do is NFS Mount the master Droplet #1 directory "/wp-content/uploads" directly to the slave Droplet # over the private network Ip addresses. Any comments?
by Etel Sverdlov
This tutorial covers setting up an NFS mount on Ubuntu 12.04. NFS mounts work to share a directory between several virtual servers. This has the advantage of saving disk space, as the home directory is only kept on one virtual private server, and others can connect to it over the network. When setting up mounts, NFS is most effective for permanent fixtures that should always be accessible.
Kamal thanks! I think that is exactly what I want to do. Is there any additional latency or speed over a private network using NFS?
"Well, moving /wp-content or /wp-content/uploads to another server would take the processing loading of off the master."

Did you read that somewhere? The most common way that I've come across for lightening up load is to move the database to its own server and incorporate caching and a CDN (for static files).
There shouldn't be any latency because it's routed inside the DC. It should be <1ms latency.
Pablo thanks for chiming in. I appreciate it, however, this is not a database. This is a directory /wp-content, so I guess you must not be familiar with WordPress because you'd have known that right off from the original question.

Kanal, you're right and I agree that NFS is most likely the best way to handle this and because like you say it is inside the DO DC PN it should be about as fast as anything could possibly be.

Yes, a database would be handled quite differently but this is a folder with images that I want to setup parallel connections to clients browsers by off loading them to a foo.domain.com

Any more feedback appreciated. However, I think I've figure it out.
Have another answer? Share your knowledge.