admin管理员组文章数量:1130349
I have multiple servers I am using for my wordpress site, each server has its own purpose. Currently I have a server that I want to use for all of wordpress file uploads, this way nothing is saved on the main server.
I searched around and was able to mount the /uploads directory from the main server to the /uploads directory on the image server. Now I see that folders and files are being created on both servers.
How can I change this so that the uploads only go to the mounted directory on my image server and doesnt save files on the main server?
I have multiple servers I am using for my wordpress site, each server has its own purpose. Currently I have a server that I want to use for all of wordpress file uploads, this way nothing is saved on the main server.
I searched around and was able to mount the /uploads directory from the main server to the /uploads directory on the image server. Now I see that folders and files are being created on both servers.
How can I change this so that the uploads only go to the mounted directory on my image server and doesnt save files on the main server?
Share Improve this question asked Dec 11, 2018 at 15:17 730wavy730wavy 1931 gold badge13 silver badges45 bronze badges 5 |1 Answer
Reset to default 1I will post an answer to stop bugging with comments.
Let's call both parties by their function on this: The NFS server, from now on "the server"; and the image server, from now on "the client".
When you mount a remote directory, you will see the files on both the server and the client. However that doesn't mean that the information is stored in both.
Everything uploaded to the mount point on the client is saved on the server (NFS Export).
On the other hand, if you write something on the server (inside the NFS export path of course), you will indeed be able to see it from the client, however it won't be stored on the client, but on the server.
When you run df -h and it returns root@mainserverIP:/var/www/html/wp-content/uploads 155G 2.8G 153G 2% /var/www/html/wp-content/uploads, you are seeing properties from the server.
If you lost connection to the server, or if you at some point umount the share, you will no longer see that line in df, neither will you have any files or used space in that directory used as mount point.
Hope it helps. Regards.
I have multiple servers I am using for my wordpress site, each server has its own purpose. Currently I have a server that I want to use for all of wordpress file uploads, this way nothing is saved on the main server.
I searched around and was able to mount the /uploads directory from the main server to the /uploads directory on the image server. Now I see that folders and files are being created on both servers.
How can I change this so that the uploads only go to the mounted directory on my image server and doesnt save files on the main server?
I have multiple servers I am using for my wordpress site, each server has its own purpose. Currently I have a server that I want to use for all of wordpress file uploads, this way nothing is saved on the main server.
I searched around and was able to mount the /uploads directory from the main server to the /uploads directory on the image server. Now I see that folders and files are being created on both servers.
How can I change this so that the uploads only go to the mounted directory on my image server and doesnt save files on the main server?
Share Improve this question asked Dec 11, 2018 at 15:17 730wavy730wavy 1931 gold badge13 silver badges45 bronze badges 5-
Hi Rich. How did you mount? if you mount a remote directory on a server you will see the files in both directories (The mount point and the server repository), however that doesn't mean they are being stored in both. You may see reality if you
umount /uploads, or withdf -h– Jorge Valentini Commented Dec 11, 2018 at 16:21 -
i used linux nfs. I ran df -h command on both servers, and on the main server I see no mention of the uploads directory. On my image server (where i want the files to be saved) i see this -
root@mainserverIP:/var/www/html/wp-content/uploads 155G 2.8G 153G 2% /var/www/html/wp-content/uploads– 730wavy Commented Dec 11, 2018 at 16:58 - That is right, 155GB is the available size of your NFS export, not your image server. – Jorge Valentini Commented Dec 11, 2018 at 17:52
- so then everything uploaded to the main server is being saved to the image server correct? – 730wavy Commented Dec 11, 2018 at 18:08
- nope, exactly opposite, please, see my answer. Regards – Jorge Valentini Commented Dec 11, 2018 at 18:59
1 Answer
Reset to default 1I will post an answer to stop bugging with comments.
Let's call both parties by their function on this: The NFS server, from now on "the server"; and the image server, from now on "the client".
When you mount a remote directory, you will see the files on both the server and the client. However that doesn't mean that the information is stored in both.
Everything uploaded to the mount point on the client is saved on the server (NFS Export).
On the other hand, if you write something on the server (inside the NFS export path of course), you will indeed be able to see it from the client, however it won't be stored on the client, but on the server.
When you run df -h and it returns root@mainserverIP:/var/www/html/wp-content/uploads 155G 2.8G 153G 2% /var/www/html/wp-content/uploads, you are seeing properties from the server.
If you lost connection to the server, or if you at some point umount the share, you will no longer see that line in df, neither will you have any files or used space in that directory used as mount point.
Hope it helps. Regards.
本文标签: linuxhow to properly mount external server directory for wordpress uploads
版权声明:本文标题:linux - how to properly mount external server directory for wordpress uploads 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749107785a2316865.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


umount /uploads, or withdf -h– Jorge Valentini Commented Dec 11, 2018 at 16:21root@mainserverIP:/var/www/html/wp-content/uploads 155G 2.8G 153G 2% /var/www/html/wp-content/uploads– 730wavy Commented Dec 11, 2018 at 16:58