1

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)

Dexirian
  • 515
  • 3
  • 15

1 Answers1

1

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

linux_fanatic
  • 4,767
  • 3
  • 19
  • 20
  • We are currently using a webadmin panel to manage our websites, and the websites are created using built-in scripts from our CP. Now if i want to change what directory websites are put into, i guess i'll have to move all the other websites to the new location as well? Does this procedure imply any other modifications in our current configuration? Btw, thanks a lot for the help – Dexirian Sep 13 '13 at 19:07
  • Oh and by the way we are running on Debian :) – Dexirian Sep 13 '13 at 19:10
  • And the server we're talking about is our dev server, so it doesnt matter if not 100% secure – Dexirian Sep 13 '13 at 19:11
  • Basically when you are using scripts from CP they should set the proper ownership of user with virtualhost directives, if you are running multiple websites but if you are running inhouse it doesn't matter changing the permission but remember website with 777 can be dangerous to your code and database. – linux_fanatic Sep 13 '13 at 19:15
  • Okay i just found out that web was a symbolic link to /var/www, so this removes the solution of switching the websites from the /web folder, so what would be my best solution in your opinion? – Dexirian Sep 13 '13 at 19:24