If I understand your question correctly, you are asking how you can change permissions for the folder /var/www/myfolder to get write permission. Depending on what you want, you can use one of the following methods.
First check the current permissions:
$ ls -l /var/www/
drwxr-xr-x 2 root root 4096 Aug 19 14:21 myfolder
There are three sets of permissions, those of the file's owner, those of the members of the file owner's group and those for everyone else. In the case above, drwxr-xr-x means:
- d : this is a directory
- rwx : The file's owner has read (r), write (w) and execute (x) rights.
- r-x : The memebers of the file's owner's group have only read and execute rights.
- r-x : So does everybody else.
Now, change the permissions:
Give write permissions to EVERYBODY:
$ sudo chmod -R a+w /var/www/myfolder
$ ls -l /var/www/
drwxrwxrwx 2 root root 4096 Aug 19 14:21 myfolder
Give write permissions to the folder's OWNER:
$ sudo chmod -R u+w /var/www/myfolder
$ ls -l /var/www/
drwxr-xr-x 2 root root 4096 Aug 19 14:32 myfolder
Give write permissions to EVERYBODY:
$ sudo chmod -R a+w /var/www/myfolder
$ ls -l /var/www/
drwxrwxrwx 2 root root 4096 Aug 19 14:33 myfolder