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!
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.
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 ofwp-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:
When You Need to Restart Apache:
Configuration Changes (
apache2.conf
orhttpd.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
oryum update
)Applying New Firewall Rules (e.g., UFW, iptables, SELinux changes)
When You Do Not Need to Restart Apache:
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) orsystemctl 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:
2️⃣ After that restart Apache with:
After this, try uploading again. If the issue persists, let me know! 🚀
- Bobby