The MU forums have moved to WordPress.org

Store user-uploaded files on separate server (7 posts)

  1. amanzi
    Member
    Posted 18 years ago #

    Hi everyone, I'm hoping someone can help me with this.

    I was wondering how you would go about storing the files that users upload on a different server? I realise this is probably more an Apache question but it definitely affects how a MU system could be deployed.

    This is the deployment scenario that I'm thinking of:

    * A load balancer directs queries to a front-end webserver. * You could have multiple front-end webservers for redundancy, but these servers would only contain identical copies of the static MU Wordpress files.
    * User-uploaded files are stored on a separate 'file-server' - this data can also be replicated for redundancy.
    * The database is stored on a separate database server, or a cluster if required.

    The bit that I'm not sure of is how the user-uploaded files (i.e. /wp-content/uploads/) could be stored seperately. Would you mount a network file share, or use some fancy htaccess work, or is there a better method?

    Your suggestions are appreciated!

    Cheers - Stuart.

  2. andrewbillits
    Member
    Posted 18 years ago #

    i'm not sure exactly how wp.com does it but I have one server just for files. You really just have to write the code for this part from scratch as there really isn't a good example anywhere that I could find.

  3. matt
    Key Master
    Posted 18 years ago #

    Most people do this with NFS.

  4. fimion
    Member
    Posted 18 years ago #

    yes, i was going to suggest NFS, because that would allow you to add more servers as neccesarry with only a little bit of modification.

  5. amanzi
    Member
    Posted 18 years ago #

    Thanks for the ideas. I've found a howto that describes how to set up a highly available NFS server here: http://www.howtoforge.com/high_availability_nfs_drbd_heartbeat

    Any tips on the MU Wordpress customisations??

  6. fimion
    Member
    Posted 18 years ago #

    you'd only need customizations if you're using multiple servers for other storage. each server would be mounted to a different folder within the files directory, then you'd need to either mofidy how the files are stored/retreived, or modify the newblog script (you can do this with a mu-plugin for ease) to make symbolic links to folders within the mounted folders for each blog, and also make sure php can follow sym links

  7. amanzi
    Member
    Posted 18 years ago #

    So I could mount an NFS share to [..]/wp-inst/wp-content/blogs.dir and then each blog's directory would get created on the NFS share? Sounds too simple... Will try this in VMware...

About this Topic