Correct permissions of files and folders Apache Ubuntu (Linux)

To change the permissions of files only:

find . -type f -print0 | xargs -0 chmod 0644 # for files

To change the permissions of folders/directories only:

find * -type d -print0 | xargs -0 chmod 0755 # for directories``

Note that 644 is the correct permission of files on a webserver (Apache) and 755 is the correct permission for folders. PHP files should have permissions of 600.