The folders / files generated by our scripts don't have the proper rights

51 views Asked by At

So the problem is, when we create new websites on our dev server, some of the files and folders created don't have the execute rights so we have to manually do a chmod -R 777 /web/websitename

Here is an example of a freshly created website folder : https://i.stack.imgur.com/ipw5E.png

So now my question is : is there a way to make it so that we don't have to manually set rights everytime a new folder is created? Thanks in advance. (the umask of the user running php / apache is 022)

1

There are 1 answers

5
linux_fanatic On BEST ANSWER

What i see you are creating your websites in /web which is not recommendable, you should always create website in /var/www/html which is the default DocumentRoot of apache in redhat/centos linux or you can use an ISP control panel package such as virtualmin with webmin to do hosting. Basically try setting the website in /var/www/html you won't need to change the permission or if you change the DocumentRoot try giving the ownership.

Thanks & Regards,
Alok