I’ve attempterd to change the permissions for wp-content and **uploads ** to “www-data:www-data” but any time I do this it will switch from “root” to “www-data” and then I’m unable to connect to the site and it will switch to https.
Solution
sudo systemctl restart apache2
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!
Heya, @spencerblackler
Yes! Restarting Apache (systemctl restart apache2
) is often necessary after changing file permissions because Apache may need to reload configurations or reset cached permissions. When you change ownership of wp-content/uploads
, Apache might still be referencing old permissions.
Regards
Heya,
Thank you for sharing the solution. In that light, here is a useful list of when you need and you don’t to restart Apache:
Configuration Changes (apache2.conf
or httpd.conf
)
Virtual Hosts Changes (/etc/apache2/sites-available/*.conf
or /etc/httpd/conf.d/*.conf
)
Enabling/Disabling Modules (a2enmod
, a2dismod
)
a2enmod
) or disabling (a2dismod
) modules, Apache must be restarted for changes to take effect.Certificate Renewals (Let’s Encrypt, SSL/TLS Updates)
/etc/letsencrypt/live/...
), you need to restart Apache to use the new certs.Changing PHP Configuration (php.ini
)
php.ini
require an Apache restart.Changing Apache MPM Settings (mpm_prefork
, mpm_event
, mpm_worker
)
Updating Apache Packages (apt update && apt upgrade
or yum update
)
Applying New Firewall Rules (e.g., UFW, iptables, SELinux changes)
Modifying .htaccess
Files
.htaccess
dynamically, so changes apply immediately without a restart.Updating Website Content (HTML, CSS, JS, Images, etc.)
Updating PHP Files (if running PHP-FPM)
php-fpm
instead of Apache.Changing Environment Variables (if using SetEnv
in Apache configs)
systemctl reload apache2
(Ubuntu/Debian) or systemctl reload httpd
(CentOS/RHEL) instead of a full restart.Minor Logging Changes (loglevel
adjustments in .htaccess
)
.htaccess
apply immediately without restarting.Database Changes (MySQL/PostgreSQL Updates)
Changes to JavaScript Frameworks (React, Vue, Angular)
Hey Spencer!
What I could suggest is:
1️⃣ Set the correct ownership with:
sudo chown -R www-data:www-data /var/www/html/wp-content/uploads
2️⃣ After that restart Apache with:
sudo systemctl restart apache2
After this, try uploading again. If the issue persists, let me know! 🚀
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.