By kaysadiller
I’ve been trying via SSH to grant my user ‘demo’ write permission to the var/www/ directory (to manage server pages). Filezilla keeps feeding back the error:" Directory /var/www/html/: permission denied". How can I fix this? I’m running Ubuntu with a LAMP stack.
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!
You might try adding your user to the www-data group:
sudo usermod -aG www-data demo
and then to be sure:
sudo chown -R www-data:www-data /var/www
and:
sudo chmod -R 775 /var/www
Having said that, doing it that way will work, but when you use “demo” to add new files, then www-data will not have ownership of those files.
I recently read a great little article with an eloquent solution that took 5 minutes to implement and works like a charm:
http://blog.netgusto.com/solving-web-file-permissions-problem-once-and-for-all/
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.