Correct permissions for /var/www/html

DWQA QuestionsCategory: linuxCorrect permissions for /var/www/html
Anonymous asked 10 years ago

First, you should ensure that your username is included in www-data group. If not, you can add your username as www-data group

sudo adduser $USER www-data

After that, you should change the ownership of /var/www to your username

sudo chown $USER:www-data -R /var/www

Next step, you should change permission to 755, not recommend changing permission to 777 for security reason

sudo chmod 0755 -R /var/www
sudo chmod g+s -R /var/www

Hope it helps…

Naresh Staplelogic Staff replied 10 years ago

use these commands if you are facing permission and you are unable to write/create file/folder under /var/www/html folder