Changing permissions for folders and files in /var/www/?

24

Solution 1

Make sure the group is www-data on '/var/www'

sudo chgrp www-data /var/www

Make '/var/www' writable for the group

sudo chmod 775 /var/www

Set the GID for www-data for all sub-folders

sudo chmod g+s /var/www

Your directory should look like this on an ls -l output.

drwxrwsr-x

Last, add your username to the www-data group (secondary group)

sudo usermod -a -G www-data [YOURUSERNAME]

Solution 2

My Suggestion for the permission you can use below command to find and set p:

find /var/www/html/ -type d -perm 777 |xargs chmod 0755 --
find /var/www/html/ -type f -perm 777 |xargs chmod 0644 --

OR

For Directories:

 find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;

For Files:

find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;
Share:
24

Related videos on Youtube

tmnsky
Author by

tmnsky

Updated on September 18, 2022

Comments

  • tmnsky
    tmnsky almost 2 years

    I have an array of names to insert into table A for processing, but I only want to insert records from the array that don't exist in either table B or C

    Any help is much appreciated!!!

    • Dan Bracuk
      Dan Bracuk over 7 years
      This is not a spoon feeding site. What specific thing are you having trouble with?
  • user244666
    user244666 over 10 years
    Does this method work with ubuntu server 12.04 LTS because I only found out that it is easier to install the Builderengine cms on 12.04 version. Thanks for the quick reply
  • Kai
    Kai over 10 years
    Yes, this should work with ubuntu server 12.04.
  • user244666
    user244666 over 10 years
    Was able to to get into 192.168.0.xx/admin/install/index but sadly my last check box for the installation progess was unchecked it was : website folder is not writable
  • user244666
    user244666 over 10 years
    doesn't matter fixed it
  • Yehonatan Tsirolnik
    Yehonatan Tsirolnik over 9 years
    The right final command is - sudo usermod -a -G GROUP USER where GROUP is the desired existing group and USER is the desired existing user
  • Yehonatan Tsirolnik
    Yehonatan Tsirolnik over 9 years
    Also, if you already have files inside /var/www then the change /var/www AT THE CMD to /var/www/* -R so for example sudo chgrp www-data /var/www/* -R