Folder permissions for uploads, images and snapshots

Hello support, i'm looking for some wisdom and guidance if possible.

I have recently change my "uploads" directory outside of my WordPress installation.

Old structure:
/var/www/mywebsite/public/wp-content/uploads

(public folder is where WordPress is installed)

New structure:
/var/www/mywebsite/images/

Sub-domain points directly to the images folder

Everything uploaded to the site is now saved in the new images directory. The reason for doing this, is because I now use a sub-domain to serve my images.

The problem I'm having is with image uploads and with Snapshot, where the new image and snapshot directories need to have folder permissions set to 777, where the old structure happily ran at 755.

I have made sure the correct user has owner ship, and tested setting different parent-folders to 755, but when I upload images, or run snapshot, I constantly get errors, stating the directory is now writeable, or images can not be move and I'm forced to use 777.

Everything works great when using 777, however I'm very concerned with using these permissions.
I'm looking for any support you might be able to provide, that will allow WordPress images to be on a sub-domain, and when uploaded automatically use the sub-domain, but with stricter folder permissions.

This is a VPS Server so I have full access if any specific changes are needed.

I appreciate any help or support you may be able to provide.

Thanks again.

  • Patrick
    • Support Monkey

    Hi there @Nicholas

    I hope you're having a great day!

    If your new /images folder is physically outside your WordPress installation, in its own subdomain, then you are likely faced with issues due to that folder not being accessed by the same user as your WP install. See this section in the codex for more on that:
    http://codex.wordpress.org/Changing_File_Permissions#Permission_Scheme_for_WordPress

    Rather than having it in its own subdomain, you can keep it inside your Wordpress install, but simply move it outside of the wp-content folder, and up one level. You don't need to mess with the permissions at all that way (755 is default and works just fine). And it's really simple too; here's how:
    https://premium.wpmudev.org/blog/change-default-wordpress-uploads-folder/

    I hope this helps! And thanks for being a member :slight_smile:

  • LDI IT
    • Site Builder

    Hello support,

    I have found one solution, keep all files loading from the sub-domain within the same parent directory as WordPress. This way all files are writeable but with 755 permissions.

    However, I'd like to know whether its possible to achieve my original question, by placing uploaded media outside the WordPress installation with stricter folder permissions.

    It would be great to know if this is possible by even placing the uploaded files on a separate server?

    Again, thank you for your support in advance.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.