how to properly mount external server directory for wordpress uploads












0














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













migrated from superuser.com Dec 11 '18 at 20:15


This question came from our site for computer enthusiasts and power users.















  • 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 with df -h
    – Jorge Valentini
    Dec 11 '18 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
    – Rich
    Dec 11 '18 at 16:58










  • That is right, 155GB is the available size of your NFS export, not your image server.
    – Jorge Valentini
    Dec 11 '18 at 17:52










  • so then everything uploaded to the main server is being saved to the image server correct?
    – Rich
    Dec 11 '18 at 18:08










  • nope, exactly opposite, please, see my answer. Regards
    – Jorge Valentini
    Dec 11 '18 at 18:59
















0














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













migrated from superuser.com Dec 11 '18 at 20:15


This question came from our site for computer enthusiasts and power users.















  • 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 with df -h
    – Jorge Valentini
    Dec 11 '18 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
    – Rich
    Dec 11 '18 at 16:58










  • That is right, 155GB is the available size of your NFS export, not your image server.
    – Jorge Valentini
    Dec 11 '18 at 17:52










  • so then everything uploaded to the main server is being saved to the image server correct?
    – Rich
    Dec 11 '18 at 18:08










  • nope, exactly opposite, please, see my answer. Regards
    – Jorge Valentini
    Dec 11 '18 at 18:59














0












0








0







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













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?







linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 '18 at 15:17









Rich

471429




471429




migrated from superuser.com Dec 11 '18 at 20:15


This question came from our site for computer enthusiasts and power users.






migrated from superuser.com Dec 11 '18 at 20:15


This question came from our site for computer enthusiasts and power users.














  • 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 with df -h
    – Jorge Valentini
    Dec 11 '18 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
    – Rich
    Dec 11 '18 at 16:58










  • That is right, 155GB is the available size of your NFS export, not your image server.
    – Jorge Valentini
    Dec 11 '18 at 17:52










  • so then everything uploaded to the main server is being saved to the image server correct?
    – Rich
    Dec 11 '18 at 18:08










  • nope, exactly opposite, please, see my answer. Regards
    – Jorge Valentini
    Dec 11 '18 at 18:59


















  • 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 with df -h
    – Jorge Valentini
    Dec 11 '18 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
    – Rich
    Dec 11 '18 at 16:58










  • That is right, 155GB is the available size of your NFS export, not your image server.
    – Jorge Valentini
    Dec 11 '18 at 17:52










  • so then everything uploaded to the main server is being saved to the image server correct?
    – Rich
    Dec 11 '18 at 18:08










  • nope, exactly opposite, please, see my answer. Regards
    – Jorge Valentini
    Dec 11 '18 at 18:59
















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 with df -h
– Jorge Valentini
Dec 11 '18 at 16:21




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 with df -h
– Jorge Valentini
Dec 11 '18 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
– Rich
Dec 11 '18 at 16:58




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
– Rich
Dec 11 '18 at 16:58












That is right, 155GB is the available size of your NFS export, not your image server.
– Jorge Valentini
Dec 11 '18 at 17:52




That is right, 155GB is the available size of your NFS export, not your image server.
– Jorge Valentini
Dec 11 '18 at 17:52












so then everything uploaded to the main server is being saved to the image server correct?
– Rich
Dec 11 '18 at 18:08




so then everything uploaded to the main server is being saved to the image server correct?
– Rich
Dec 11 '18 at 18:08












nope, exactly opposite, please, see my answer. Regards
– Jorge Valentini
Dec 11 '18 at 18:59




nope, exactly opposite, please, see my answer. Regards
– Jorge Valentini
Dec 11 '18 at 18:59










1 Answer
1






active

oldest

votes


















1














I 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.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "110"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f321685%2fhow-to-properly-mount-external-server-directory-for-wordpress-uploads%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I 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.






    share|improve this answer


























      1














      I 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.






      share|improve this answer
























        1












        1








        1






        I 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.






        share|improve this answer












        I 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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 11 '18 at 18:59







        Jorge Valentini





































            draft saved

            draft discarded




















































            Thanks for contributing an answer to WordPress Development Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f321685%2fhow-to-properly-mount-external-server-directory-for-wordpress-uploads%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Puebla de Zaragoza

            Musa