Website move especially from the virtual space or Windows to the Linux VPS will appear file permissions issues, usually directories are 755 permissions, file is 644 permissions. One change is more troublesome, you can use the command simple and quick modification.
First the CD to the site directory you want to modify, and then run the following two commands to quickly batch modify permissions.
Find-type D|xargs chmod 755
Find-type F|xargs chmod 644
In addition, often modified with sftp to upload a new file is the root group, can be modified to the WWW user group, the following command:
Chown-r www:www/home/wwwroot/Web Site Directory
Here's another way to add
Method 1
Find. -exec sh-c ' If [[d ' {} ']]; Then chmod 755 "{}"; else chmod 644 "{}"; Fi "\;
Method 2
Find./-type f-print |xargs chmod 644;
Find./-type D-print|xargs chmod 755;
Method 3
Always use the command to record.
Find/path-type f-exec chmod 644 {} \; Set file permissions to 644
Find/path-type d-exec chmod 755 {} \; Set directory permissions to 755
Recommended methods:
chmod 644-r./
Find./-type D-print|xargs chmod 755;
Methods 1 and 2 are found on the Internet, and when the test is discovered, setting 644 is a bit problematic. So, the recommended method inside, I first use chmod all set 644, and then use Find to set the directory section to 755. Note that the./is for the site code in the directory set up Oh.