Question

Block Storage with Wordpress No Longer Web Writable in Ubuntu 20.04?

I have previously set up my wordpress installation successfully, with a mount at /mnt/MNTNAME and a symlink in my wordpress web directory …/public_html/wp-content/uploads. This was in Ubuntu 18.04. All was well, able to upload media in wordpress without issue.

I am working on an upgrade to the server, and migrated the install, and wasn’t able to figure out why on the new server, everything works except media uploads in wordpress.

Unable to create directory wp-content/uploads/.... Is its parent directory writable by the server?

After many hours of investigation, I think I’ve finally narrowed it down. Since the /mnt/ folder is outside of the web-writeable …/public_ html, the error comes up. As soon as I move the mnt into /public_ html, it works. This was not the case before. Any suggestions on how I can keep the previous setup and still get uploads to work with /mnt/ outside of the web writeable directory?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
July 7, 2021
Accepted Answer

Hello,

It sounds like that you might have SELinux enabled. To check if this is the case run the following command:

getenforce

If SELinux is enabled, you could allow the Apache service to write to that specific directory with the following command:

chcon -R -t httpd_sys_rw_content_t /mnt/path

Alternatively, you could manually mount the disk to your uploads directory directly, as per the instructions here:

https://docs.digitalocean.com/products/volumes/how-to/mount/

Regards, Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.