Assuming you are using Apache and running it as an unprivileged user, the web server should be able to read and serve your content.
For directories, Apache requires both reading and execution. HTML, JS, CSS, and image files only require read permission. Executable scripts, such as PHP, require that both reading and execution be performed as intended. Therefore, for directories and PHP scripts, you want to use o+rx or in octal maybe 755 , depending on how you want to set the group ownership. And for non-executable content such as HTML, JS, CSS and image files, you must use o+r or 744 in octal format.
The eighth is a series of bit flags for owner , group and other , respectively. 1 corresponds to execute , 2 corresponds to write , and 4 corresponds to read .
To determine what a flag is, you add every bit for each group. Thus, 755 means that the owner has full permissions (1+2+4) , and the group and others have read and execute permissions (1+4) .
source share